[NETVIRT-761] aclservice component tests broken Created: 04/Jul/17  Updated: 19/Oct/17  Resolved: 11/Jul/17

Status: Resolved
Project: netvirt
Component/s: General
Affects Version/s: Nitrogen
Fix Version/s: None

Type: Bug
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 8800

 Description   

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)



 Comments   
Comment by Michael Vorburger [ 04/Jul/17 ]

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

TBD next, and BEFORE merging the following changes (because they will cause aclservice test failures otherwise)

One can locally see the test failures by adding this to the aclservice-impl/pom.xml:

<dependency>
<!-- TODO Remove this again; this is just temporary, for local testing; c/59950 will do this in mdsal -->
<groupId>ch.vorburger</groupId>
<artifactId>xtendbeans</artifactId>
<version>1.3.0</version>
<scope>test</scope>
</dependency>

> fixing xtendbeans to support Builders which have no getters, only setters

https://github.com/vorburger/xtendbeans/commit/377364c67b80f1253fb25a82ae596fc9dc585a1d

> upgrade ODL (mdsal) to use new release

https://git.opendaylight.org/gerrit/#/c/59950/

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

https://git.opendaylight.org/gerrit/#/c/59951/

Comment by Sam Hague [ 05/Jul/17 ]

https://git.opendaylight.org/gerrit/59954

Generated at Wed Feb 07 20:22:24 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.