Skip to content

Commit

Permalink
Make MultiSenderTest more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
komamitsu committed Oct 11, 2015
1 parent 1ca7ea1 commit f660e39
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public void testSend()
server0.start();
final MockMultiTCPServerWithMetrics server1 = new MockMultiTCPServerWithMetrics();
server1.start();
TimeUnit.MILLISECONDS.sleep(1000);

int concurency = 20;
final int reqNum = 5000;
Expand Down Expand Up @@ -92,7 +93,13 @@ public void run()
});
}

assertTrue(latch.await(6, TimeUnit.SECONDS));
for (int i = 0; i < 60; i++) {
if (latch.await(1, TimeUnit.SECONDS)) {
break;
}
}
assertEquals(0, latch.getCount());

sender.close();
TimeUnit.MILLISECONDS.sleep(1000);
server1.stop();
Expand Down

0 comments on commit f660e39

Please sign in to comment.