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

[iotdb] 01/01: fix the UT of ConfigExecution

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

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

commit b9b54e5d966136b9de0f084b06ea3bb7771fb7a2
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Thu Apr 21 11:18:18 2022 +0800

    fix the UT of ConfigExecution
---
 .../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();
     }
   }