[TEST] wait for threads to finish writing before checking

we need to make sure we wait for all threads to finish executing, since there might still be a thread around even post await (i.e. just starting) performing updates
This commit is contained in:
Shay Banon 2014-07-06 16:08:09 +02:00
parent 7ca296987d
commit 8d793391da
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ public class UpdateInPlaceMapTests extends ElasticsearchTestCase {
numberOfMutations.await();
for (Thread thread : threads) {
thread.join();
}
// verify the 2 maps are the same
assertThat(Iterables.toArray(map.values(), String.class), arrayContainingInAnyOrder(Iterables.toArray(verifier.values(), String.class)));
}