accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [2/2] git commit: ACCUMULO-2061 Make sure we sleep to allow the processes to die before fs rename
Date Thu, 20 Mar 2014 20:18:13 GMT
ACCUMULO-2061 Make sure we sleep to allow the processes to die before fs rename

If we don't wait a little bit, it's possible that the MAC processes will
recreate a file in the directory we just renamed which will cause the test
to fail despite Accumulo doing the right things.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e796ffc7
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e796ffc7
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e796ffc7

Branch: refs/heads/ACCUMULO-2061
Commit: e796ffc7ae2195ba8feb877bded675f4c4346f30
Parents: f5ba4d5
Author: Josh Elser <elserj@apache.org>
Authored: Thu Mar 20 16:16:30 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Mar 20 16:16:30 2014 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/accumulo/test/VolumeIT.java   | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e796ffc7/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
index c0e41c1..d014e0e 100644
--- a/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/VolumeIT.java
@@ -488,6 +488,19 @@ public class VolumeIT extends ConfigurableMacIT {
 
     cluster.stop();
 
+    // If we don't wait, we have no certainty that the processes will actually be
+    // dead by the time we attempt the rename. If the processes haven't died, it's 
+    // possible that an open file will "recreate" the old volume directories which
+    // will cause this test to fail.
+    // For reference, OpenJDK6 will send SIGTERM to each process in cluster.stop()
+    try {
+      Thread.sleep(5000);
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      log.error("Test thread interrupted", e);
+      Assert.fail("Test thread interrupted");
+    }
+
     File v1f = new File(v1.toUri());
     File v8f = new File(new File(v1.getParent().toUri()), "v8");
     Assert.assertTrue("Failed to rename " + v1f + " to " + v8f, v1f.renameTo(v8f));


Mime
View raw message