Repository: accumulo Updated Branches: refs/heads/master 6ca80effe -> 28816315f
ACCUMULO-2756 Ensure multiTableTest actually runs Check output of launched processes and wait for them to finish before shutting down the test. Ensure readonly execution waits for tables to exist. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f39b9863 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f39b9863 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f39b9863 Branch: refs/heads/master Commit: f39b9863ce65df8d618e4fed125867720d99e07d Parents: 4384b31 Author: Christopher Tubbs <ctubb...@apache.org> Authored: Tue Apr 29 15:32:23 2014 -0400 Committer: Christopher Tubbs <ctubb...@apache.org> Committed: Tue Apr 29 15:35:45 2014 -0400 ---------------------------------------------------------------------- .../java/org/apache/accumulo/test/TestMultiTableIngest.java | 4 ++++ .../org/apache/accumulo/test/functional/ReadWriteIT.java | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/f39b9863/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java b/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java index 2a6d9ae..7a848a3 100644 --- a/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java +++ b/test/src/main/java/org/apache/accumulo/test/TestMultiTableIngest.java @@ -32,6 +32,7 @@ import org.apache.accumulo.core.client.Scanner; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Mutation; import org.apache.accumulo.core.data.Value; +import org.apache.accumulo.fate.util.UtilWaitThread; import org.apache.accumulo.server.cli.ClientOpts; import org.apache.hadoop.io.Text; @@ -51,6 +52,9 @@ public class TestMultiTableIngest { private static void readBack(Opts opts, ScannerOpts scanOpts, Connector conn, List<String> tableNames) throws Exception { int i = 0; for (String table : tableNames) { + // wait for table to exist + while (!conn.tableOperations().exists(table)) + UtilWaitThread.sleep(100); Scanner scanner = conn.createScanner(table, opts.auths); scanner.setBatchSize(scanOpts.scanBatchSize); int count = i; http://git-wip-us.apache.org/repos/asf/accumulo/blob/f39b9863/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java index 6dbecfa..023a308 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ReadWriteIT.java @@ -79,8 +79,7 @@ public class ReadWriteIT extends ConfigurableMacIT { assertTrue(result.length() > 100); log.debug("Stopping mini accumulo cluster"); Process shutdown = cluster.exec(Admin.class, "stopAll"); - shutdown.waitFor(); - assertTrue(shutdown.exitValue() == 0); + assertEquals(0, shutdown.waitFor()); log.debug("success!"); monitor.destroy(); } @@ -124,8 +123,10 @@ public class ReadWriteIT extends ConfigurableMacIT { // Write to multiple tables String instance = cluster.getInstanceName(); String keepers = cluster.getZooKeepers(); - exec(TestMultiTableIngest.class, args("--count", "" + ROWS, "-u", "root", "-i", instance, "-z", keepers, "-p", ROOT_PASSWORD)); - exec(TestMultiTableIngest.class, args("--count", "" + ROWS, "--readonly", "-u", "root", "-i", instance, "-z", keepers, "-p", ROOT_PASSWORD)); + Process p1 = exec(TestMultiTableIngest.class, args("--count", "" + ROWS, "-u", "root", "-i", instance, "-z", keepers, "-p", ROOT_PASSWORD)); + Process p2 = exec(TestMultiTableIngest.class, args("--count", "" + ROWS, "--readonly", "-u", "root", "-i", instance, "-z", keepers, "-p", ROOT_PASSWORD)); + assertEquals(0, p1.waitFor()); + assertEquals(0, p2.waitFor()); } @Test