Browse Source

code smell

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

7
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 java.util.Date;
import org.junit.After; import org.junit.After;
import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -83,10 +84,16 @@ public class TaskResponseServiceTest {
Mockito.when(channel.writeAndFlush(Mockito.any())).thenReturn(null); Mockito.when(channel.writeAndFlush(Mockito.any())).thenReturn(null);
taskResponseService.addResponse(ackEvent); taskResponseService.addResponse(ackEvent);
taskResponseService.addResponse(resultEvent); taskResponseService.addResponse(resultEvent);
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
Thread.currentThread().interrupt();
}
} }
@After @After
public void after() { public void after() {
Assert.assertEquals(0, taskResponseService.getEventQueue().size());
taskResponseService.stop(); taskResponseService.stop();
} }

Loading…
Cancel
Save