Skip to content

Commit

Permalink
[Misc] DefaultTasksManagerTest.addTaskDuringTaskExecution is flickering
Browse files Browse the repository at this point in the history
Prevent identical tasks to be queued at the same millisecond until XWIKI-21820 is closed.
  • Loading branch information
manuelleduc committed Jan 22, 2024
1 parent 3f95f97 commit 1ba1762
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ void addTaskDuringTaskExecution() throws Exception

// Block the fist task and let the next tasks execute instantly.
doAnswer(invocation -> {
// TODO: Remove once XWIKI-21820 is closed, without this sleep the test might flicker if the two addTask to
// doc 442 version 1.2 are executed during the same millisecond, leading to a flickering test.
Thread.sleep(1);
taskDataCompletableFuture.set(this.tasksManager.addTask("wikiA", 42, "1.2", "concurrent"));
return null;
})
Expand Down

0 comments on commit 1ba1762

Please sign in to comment.