String[] qNodeAddresses = new String[N_QNODES];
for(int i = 0; i < N_QNODES; i++) {
qNodeAddresses[i] = getqNodes().get(i).getAddress();
}
final SploutClient client = new SploutClient(qNodeAddresses);
final Tablespace testTablespace = createTestTablespace(N_DNODES);
final Random random = new Random(SEED);
final AtomicBoolean failed = new AtomicBoolean(false);
final AtomicInteger iteration = new AtomicInteger(0);
final Set<Integer> iterationsSeen = new HashSet<Integer>();
deployIteration(0, random, client, testTablespace);
for(QNode qnode : getqNodes()) {
// Make sure all QNodes are aware of the the first deploy
// There might be some delay as they have to receive notifications via Hazelcast etc
long waitedSoFar = 0;
QueryStatus status = null;
SploutClient perQNodeClient = new SploutClient(qnode.getAddress());
do {
status = perQNodeClient.query(TABLESPACE, "0", "SELECT * FROM " + TABLE + ";", null);
Thread.sleep(100);
waitedSoFar += 100;
if(waitedSoFar > 5000) {
throw new AssertionError("Waiting too much on a test condition");
}