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

gaojun2048 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new 0e8351d56 [Hotfix][e2e] fix JobRestoreWhenMasterNodeSwitch method NPE 
(#3237)
0e8351d56 is described below

commit 0e8351d56facf36681ea001594d0855156350ccc
Author: TaoZex <[email protected]>
AuthorDate: Mon Oct 31 15:25:52 2022 +0800

    [Hotfix][e2e] fix JobRestoreWhenMasterNodeSwitch method NPE (#3237)
    
    * [Hotfix][e2e] fix JobRestoreWhenMasterNodeSwitch method NPE
---
 .../apache/seatunnel/engine/server/CoordinatorServiceTest.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git 
a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/CoordinatorServiceTest.java
 
b/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/CoordinatorServiceTest.java
index 2f11954c3..564253d5f 100644
--- 
a/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/CoordinatorServiceTest.java
+++ 
b/seatunnel-engine/seatunnel-engine-server/src/test/java/org/apache/seatunnel/engine/server/CoordinatorServiceTest.java
@@ -153,14 +153,18 @@ public class CoordinatorServiceTest {
                 }
             });
 
-        // wait job restore
-        Thread.sleep(5000);
+        // wait job restore and leave running status
+        await().atMost(200000, TimeUnit.MILLISECONDS)
+            .untilAsserted(
+                () -> Assertions.assertNotEquals(PipelineStatus.RUNNING,
+                      
server2.getCoordinatorService().getJobMaster(jobId).getPhysicalPlan().getPipelineList().get(0)
+                        .getPipelineState()));
 
         // pipeline will recovery running state
         await().atMost(200000, TimeUnit.MILLISECONDS)
             .untilAsserted(
                 () -> Assertions.assertEquals(PipelineStatus.RUNNING,
-                    
server2.getCoordinatorService().getJobMaster(jobId).getPhysicalPlan().getPipelineList().get(0)
+                      
server2.getCoordinatorService().getJobMaster(jobId).getPhysicalPlan().getPipelineList().get(0)
                         .getPipelineState()));
 
         server2.getCoordinatorService().cancelJob(jobId);

Reply via email to