james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject [james-project] 08/09: JAMES-2777 fix too strong expectation about task cancellation
Date Fri, 14 Jun 2019 16:32:59 GMT
This is an automated email from the ASF dual-hosted git repository.

matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 6cfdc93a153a6cd4b178010b7466b318dc76a80f
Author: Matthieu Baechler <matthieu@apache.org>
AuthorDate: Wed Jun 12 16:13:18 2019 +0200

    JAMES-2777 fix too strong expectation about task cancellation
---
 server/task/src/main/java/org/apache/james/task/Task.java               | 2 +-
 .../task/src/test/java/org/apache/james/task/MemoryTaskManagerTest.java | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/task/src/main/java/org/apache/james/task/Task.java b/server/task/src/main/java/org/apache/james/task/Task.java
index 82b7670..0c79ec0 100644
--- a/server/task/src/main/java/org/apache/james/task/Task.java
+++ b/server/task/src/main/java/org/apache/james/task/Task.java
@@ -74,7 +74,7 @@ public interface Task {
      *
      * @return Return true if fully migrated. Returns false otherwise.
      */
-    Result run();
+    Result run() throws InterruptedException;
 
 
     default String type() {
diff --git a/server/task/src/test/java/org/apache/james/task/MemoryTaskManagerTest.java b/server/task/src/test/java/org/apache/james/task/MemoryTaskManagerTest.java
index 3533eb3..691bbc9 100644
--- a/server/task/src/test/java/org/apache/james/task/MemoryTaskManagerTest.java
+++ b/server/task/src/test/java/org/apache/james/task/MemoryTaskManagerTest.java
@@ -92,6 +92,7 @@ class MemoryTaskManagerTest {
         TaskId id = memoryTaskManager.submit(() -> {
             waitForTaskToBeLaunched.countDown();
             await(task1Latch);
+            Thread.sleep(1);
             count.incrementAndGet();
             return Task.Result.COMPLETED;
         });


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message