Uploaded image for project: 'netvirt'
  1. netvirt
  2. NETVIRT-761

aclservice component tests broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • None
    • Nitrogen
    • General
    • None
    • Operating System: All
      Platform: All

    • 8800

      While starting to investigate the sporadic test failures we see in the aclservice component tests (AclServiceTestBase: AclServiceStatefulTest, AclServiceStatelessTest, AclServiceTestBaseIPv6, AclServiceStatefulIPv6Test), I realized that before & in parallel to solving that, we should probably tackle a bigger problem in those tests... they don't actually work and don't really test much, anymore!

      The following messages appear in the log of e.g. AclServiceStatefulTest's newInterfaceWithMultipleAcl() :

      [main] WARN org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager - assert containsExactlyElementsIn() failed
      java.lang.AssertionError: Not true that <[FlowEntity ...]> contains exactly <[FlowEntity ...]>
      [main] WARN org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager - assert failed [order ignored!]; expected flows: [FlowEntity ...]
      [main] WARN org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager - assert failed [order ignored!]; actual flows : [FlowEntity ...]

      which points out a mismatch between expected and actual flows - but the test does not fail, when this occurs!

      This is an impact of the FlowEntity-immutable changes https://git.opendaylight.org/gerrit/#/c/53763/ and https://git.opendaylight.org/gerrit/#/c/54390/ from a few 2-3 months - which we, apparently, completely missed (I'll create a new non-regression test to avoid this in the future).

      What happened is that the new FlowEntityBuilder, generated by https://immutables.github.io through the @Immutable
      @OpenDaylightImmutableStyle annotations on the abstract class FlowEntity, does not have getters anymore (as the original FlowEntity used to have) - only setters. This is how Immutables.org does it (see also https://github.com/immutables/immutables/issues/432), and normally is fine and should not be a problem.

      BUT https://github.com/vorburger/xtendbeans, due to a "bug" (this was never needed before) did not support this (it returned almost empty object initialization literals; because it did not "see" the properties, when there is no getter on a Builder).

      And due to an oversight / bug in TestIMdsalApiManager's assertFlowsInAnyOrder(), this caused only the logs above, but not the tests to fail!

      The solution includes a number of steps, including:

      1. fixing xtendbeans to support Builders which have no getters, only setters; upgrade ODL (mdsal) to use new release

      2. fixing TestIMdsalApiManager's assertFlowsInAnyOrder() to actually fail when flows mismatch

      3. fixing aclservice code (or just updating FlowEntryObjectsStateful.xtend) to fix failures that have crept in (not noticed)

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: