You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/04/21 06:38:34 UTC

[iotdb] branch master updated: fix the UT of ConfigExecution (#5621)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 254ca0532b fix the UT of ConfigExecution (#5621)
254ca0532b is described below

commit 254ca0532bad7a5a29738aefd81025a4369d994a
Author: Zhang.Jinrui <xi...@gmail.com>
AuthorDate: Thu Apr 21 14:38:27 2022 +0800

    fix the UT of ConfigExecution (#5621)
---
 .../org/apache/iotdb/db/mpp/execution/ConfigExecutionTest.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/ConfigExecutionTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/ConfigExecutionTest.java
index 9a1c36beb5..58d376bf87 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/ConfigExecutionTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/ConfigExecutionTest.java
@@ -137,8 +137,14 @@ public class ConfigExecutionTest {
     execution.start();
     try {
       resultThread.join();
-      Assert.fail("InterruptedException should be threw here");
+      // There is a scenario that the InterruptedException won't throw here. If the
+      // execution.start() runs faster and completes the whole process including
+      // invoking Thread.interrupt() before join() is invoked, then the join won't
+      // receive the interrupt signal. So we cannot assert fail here.
+      // Assert.fail("InterruptedException should be threw here");
     } catch (InterruptedException e) {
+      ExecutionResult result = execution.getStatus();
+      Assert.assertEquals(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), result.status.code);
       execution.stop();
     }
   }