-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.8.0-HF30, 6.0-HF05, 7.1
-
Fix Version/s: 5.8.0-HF31, 6.0-HF06, 7.2
-
Component/s: Core VCS
-
Tags:
When writing unit test there is a way to wait for asynchronous listener using WorkManager#awaitCompletion.
This is reliable only if PostCommit synchronous listener does not timeout.
Here is a case where it fails:
main: commit postcommit1: start main: wait for postcommit1 for 300ms main: timeout 300ms, postcommit1 continue to run (now asynchronously) main: call awaitCompletion main: awaitCompletion returns postcommit1: commit and generate new async jobs main: get random results because there are async jobs running
May be awaitCompletion should be extended to wait for PostCommit listener.
Note that there is a warning when a post commit listener timeout, it should be taken as a bad smell indicator in unit test:
WARN [PostCommitEventExecutor] Events postcommit execution exceeded timeout of 300ms, leaving thread running
- is required by
-
NXP-16475 Fix random failure on TestReindex.shouldReindexDocument
- Resolved