The fix made for
NXP-30399, replacing the forEach loop in NuxeoDriveGroupUpdateListener by a bulk action, introduced a random test error in GroupChangesTestSuite.testGroupChangesOnSyncRoot:
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:
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.