-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.10-HF48, 11.x, 2021.4
-
Tags:
-
Team:PLATFORM
-
Sprint:nxplatform #36
-
Story Points:3
The fix made for NXP-30399, replacing the forEach loop in NuxeoDriveGroupUpdateListener by a bulk action, introduced a random test error in GroupChangesTestSuite.testGroupChangesOnSyncRoot:
java.lang.AssertionError: expected:<1> but was:<0> at org.junit.Assert.fail(Assert.java:89) at org.junit.Assert.failNotEquals(Assert.java:835) at org.junit.Assert.assertEquals(Assert.java:647) at org.junit.Assert.assertEquals(Assert.java:633) at org.nuxeo.drive.fixtures.GroupChangesTestSuite.testGroupChanges(GroupChangesTestSuite.java:312) at org.nuxeo.drive.fixtures.GroupChangesTestSuite.testGroupChangesOnSyncRoot(GroupChangesTestSuite.java:160)
This is probably because the call to TransactionalFeature#nextTransaction() waits for the NuxeoDriveGroupUpdateListener async listener and the subsequent FireGroupUpdatedEventAction bulk action, but not always for the NuxeoDriveVirtualEventLogger async listener triggered afterwards.
Indeed, the call sequence is quite complex:
NuxeoDriveGroupUpdateListener (async) -> FireGroupUpdatedEventAction -> NuxeoDriveFileSystemDeletionListener (sync) -> NuxeoDriveVirtualEventLogger (async) -> AuditLogger#addLogEntries
A possible solution is to double the calls to TransactionalFeature#nextTransaction() in GroupChangesTestSuite#commitAndWaitForAsyncCompletion().
In the future, we'll want to avoid having such a stack of async processing as it's very difficult to analyze and test.
BAF triggering WorkManager is not a good idea.
Using BAF everywhere should solve the problem.
- is related to
-
NXP-30399 Fix Transaction timeout during nuxeoDriveFileSystemDeletionListener
- Resolved
- Is referenced in