Fix test bug in ClusterServiceIT#testClusterStateBatchedUpdates

This commit fixes a test bug in
ClusterService#testClusterStateBatchedUpdates. In particular, in the
case that an executor did not receive a task assignment from the random
assignments, it would not have an entry in the map of executors to
counts of assigned tasks. The fix is to just check if each executor has
an entry in the counts map.
This commit is contained in:
Jason Tedor 2015-12-04 16:25:36 -05:00
parent 3ab7451ca5
commit e7952e2023
1 changed files with 3 additions and 1 deletions

View File

@ -836,7 +836,9 @@ public class ClusterServiceIT extends ESIntegTestCase {
// assert each executor executed the correct number of tasks
for (TaskExecutor executor : executors) {
assertEquals((int)counts.get(executor), executor.counter.get());
if (counts.containsKey(executor)) {
assertEquals((int) counts.get(executor), executor.counter.get());
}
}
// assert the correct number of clusterStateProcessed events were triggered