From 858c4f32875f2294bac5f1eae11142568bb0f367 Mon Sep 17 00:00:00 2001 From: CalvinKirs Date: Wed, 25 Nov 2020 09:20:58 +0800 Subject: [PATCH] code smell --- .../master/processor/queue/TaskResponseServiceTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java index 06bac173c7..3d5dc0c87b 100644 --- a/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java +++ b/dolphinscheduler-server/src/test/java/org/apache/dolphinscheduler/server/master/processor/queue/TaskResponseServiceTest.java @@ -24,6 +24,7 @@ import org.apache.dolphinscheduler.service.process.ProcessService; import java.util.Date; import org.junit.After; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -83,10 +84,16 @@ public class TaskResponseServiceTest { Mockito.when(channel.writeAndFlush(Mockito.any())).thenReturn(null); taskResponseService.addResponse(ackEvent); taskResponseService.addResponse(resultEvent); + try { + Thread.sleep(1000); + } catch (InterruptedException ignored) { + Thread.currentThread().interrupt(); + } } @After public void after() { + Assert.assertEquals(0, taskResponseService.getEventQueue().size()); taskResponseService.stop(); }