fixed racew in unit test

This commit is contained in:
Greg Wilkins 2016-10-13 22:15:03 +11:00
parent 8eb56edc8a
commit cb74cb8c1f
1 changed files with 6 additions and 3 deletions

View File

@ -238,10 +238,13 @@ public class ThreadLimitHandlerTest
latch.countDown(); latch.countDown();
while(total.get()<10 && System.nanoTime()<wait) while(total.get()<10 && System.nanoTime()<wait)
Thread.sleep(1); Thread.sleep(10);
assertThat(count.get(),is(0));
assertThat(total.get(),is(10)); assertThat(total.get(),is(10));
while(count.get()>0 && System.nanoTime()<wait)
Thread.sleep(10);
assertThat(count.get(),is(0));
} }