Fix race in waitUntilSettled

The following sequence can happen:

- Lock run handler in test (test thread)
- Verify that queues are empty (test thread)
- Nodepool request completes (fake nodepool thread)
- Nodepool request complete event added to queue (zookeeper thread)
- Nodepool request record removed (zookeeper thread)
- waitUntilSettled declares settled (test thread)

This should prevent that by ensuring that we check for empty queues
*after* verifying that there are no outstanding nodepool requests.

Change-Id: I0d7fbffec8d9d9c8a53d571afab82dd59a2537e4
1 file changed