Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7290 Online snapshots
  3. HBASE-7778

[snapshot 130201 merge] Tests with sleep after minicluster shutdown fail due to interrupt flag.

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • hbase-7290, 0.95.2
    • 0.95.0
    • None
    • None
    • Reviewed

    Description

      Something in the merge has set the interrupted flag on the main test threads of TestReplicationDisabledinactivePeer, TestRestartCluster, and TestCatalogTrackerOnCluster.

      These unacceptable hacks make the tests run and pass:

      diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTrackerOnCluster.java b/hbase-server/src/test/java/or
      index f3e57d6..a8d2ef7 100644
      --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTrackerOnCluster.java
      +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/catalog/TestCatalogTrackerOnCluster.java
      @@ -47,6 +47,7 @@ public class TestCatalogTrackerOnCluster {
           // Shutdown hbase.
           UTIL.shutdownMiniHBaseCluster();
           // Give the various ZKWatchers some time to settle their affairs.
      +    Thread.interrupted(); // HACK clear interrupt state.
           Thread.sleep(1000);
       
           // Mess with the root location in the running zk.  Set it to be nonsense.
      diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java b/hbase-server/src/test/java/org/apache/h
      index 15225e1..9f7f526 100644
      --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
      +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestRestartCluster.java
      @@ -108,6 +108,7 @@ public class TestRestartCluster {
           UTIL.shutdownMiniHBaseCluster();
       
           LOG.info("\n\nSleeping a bit");
      +    Thread.interrupted(); // HACK clear interrupt state.
           Thread.sleep(2000);
       
           LOG.info("\n\nStarting cluster the second time");
      diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java b/hbase-server/src/t
      index b089fbe..8162f4b 100644
      --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java
      +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationDisableInactivePeer.java
      @@ -50,6 +50,7 @@ public class TestReplicationDisableInactivePeer extends TestReplicationBase {
           // enabling and shutdown the peer
           admin.enablePeer("2");
           utility2.shutdownMiniHBaseCluster();
      +    Thread.interrupted(); // HACK clear interrupted flag.
       
           byte[] rowkey = Bytes.toBytes("disable inactive peer");
           Put put = new Put(rowkey);
      

      On the snapshot branch and on the trunk branch before the merge, these tests passed. Need to figure out how they combination caused this behavior change.

      Attachments

        1. hbase-7778.patch
          3 kB
          Jonathan Hsieh

        Issue Links

          Activity

            People

              jmhsieh Jonathan Hsieh
              jmhsieh Jonathan Hsieh
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: