Browse Source

Time is too small and the task is not finished

pull/3/MERGE
CalvinKirs 4 years ago
parent
commit
b3991d9dee
  1. 14
      dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java

14
dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java

@ -88,11 +88,17 @@ public class TaskResponseServiceTest {
@After @After
public void after() { public void after() {
try {
Thread.sleep(60000); long startTime = System.currentTimeMillis();
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt(); long maxWaitTime = 3 * 60 * 1000;
while (System.currentTimeMillis() - maxWaitTime - startTime < 0) {
if (taskResponseService.getEventQueue().size() == 0) {
return;
}
} }
Assert.assertEquals(0, taskResponseService.getEventQueue().size()); Assert.assertEquals(0, taskResponseService.getEventQueue().size());
taskResponseService.stop(); taskResponseService.stop();
} }

Loading…
Cancel
Save