assertEquals(0, nodeqQueue.size());
}
// node completion does not add another balance op since not enough nodes
// are there
MasterQueue masterQueue = _protocol.publishMaster(Mocks.mockMaster());
assertEquals(0, masterQueue.size());
balanceOperation.nodeOperationsComplete(_context, Collections.EMPTY_LIST);
assertEquals(0, masterQueue.size());
// add node and now the balance op should add itself for retry
Node node3 = Mocks.mockNode();
NodeQueue nodeQueue3 = Mocks.publisNode(_protocol, node3);
balanceOperation.nodeOperationsComplete(_context, Collections.EMPTY_LIST);
assertEquals(1, masterQueue.size());
// now do the balance
assertEquals(0, nodeQueue3.size());
balanceOperation.execute(_context, EMPTY_LIST);
assertEquals(1, nodeQueue3.size());
publisShard(node3, nodeQueue3);
// now it shouldn't add itself again since the index is balanced
balanceOperation.nodeOperationsComplete(_context, Collections.EMPTY_LIST);
assertEquals(1, masterQueue.size());
}