public void testNodes9() { const int testIterations = 9; CountdownEvent latch = new CountdownEvent(testIterations); ThreadSafeInt failureCounter = new ThreadSafeInt(0); for (var i = 0; i < testIterations; i++) { runElectionSupportThread(latch, failureCounter); } Assert.assertEquals(0, failureCounter.Value); if (!latch.Wait(10 * 1000)) { logger.debugFormat("Waited for all threads to start, but timed out. We had {0} failures.", failureCounter.Value); } }
private void runElectionSupportThread(CountdownEvent latch, ThreadSafeInt failureCounter) { runElectionSupportThread(latch, failureCounter, 3000); }