Skip to content

Commit

Permalink
ffooof
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cole committed Aug 14, 2016
1 parent 7588694 commit 916af96
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void exceptionsArentCached() throws Exception {
/**
* This shows that any number of threads perform a computation only once.
*/
@Test(timeout = 3000L) // 1000 for the selects + expiration (which is 1 second)
@Test(timeout = 3500L) // == 2 seconds latch + 1 second sleep + fudge
public void multithreaded() throws Exception {
Session session = CassandraTestGraph.INSTANCE.storage.get().session();
DeduplicatingExecutor executor =
Expand All @@ -156,7 +156,11 @@ public void multithreaded() throws Exception {
futures.add(executor.maybeExecuteAsync(now.bind(), "bar"));
});
}
latch.await();

// 2 seconds = 1000 for the selects + expiration (which is 1 second)
assertThat(latch.await(2, TimeUnit.SECONDS))
.withFailMessage("received " + latch.getCount() + "/" + loopCount)
.isTrue();

ImmutableSet<ListenableFuture<?>> distinctFutures = ImmutableSet.copyOf(futures);

Expand Down

0 comments on commit 916af96

Please sign in to comment.