This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit d571b6fdb7a2b8905a3077d80cf42866ef632cef Author: Benoit Tellier <[email protected]> AuthorDate: Mon May 18 13:40:04 2020 +0700 JAMES-3172 SerialTaskManagerWorker cancelation is not immediate The uses of signals can not be expected to be immediate. Thus `theWorkerShouldCancelAnInProgressTask` test was failing as the cancellation could be repeated after the mock check, eventually failing the test. This effectively solves the instability noticed on `theWorkerShouldCancelAnInProgressTask` --- .../test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java b/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java index ed17928..964e8d1 100644 --- a/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java +++ b/server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java @@ -225,6 +225,10 @@ class SerialTaskManagerWorkerTest { resultMono.block(Duration.ofSeconds(10)); + // Due to the use of signals, cancellation cannot be instantaneous + // Let a grace period for the cancellation to complete to increase test stability + Thread.sleep(50); + verify(listener, atLeastOnce()).cancelled(id, Optional.empty()); verifyNoMoreInteractions(listener); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
