sijie closed pull request #1179: Handle for 4.6.0 and 4.6.1 specially in bc 
test shutdown
URL: https://github.com/apache/bookkeeper/pull/1179
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy
 
b/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy
index 7933c2f1e..b834e4dac 100644
--- 
a/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy
+++ 
b/tests/backward-compat/upgrade/src/test/groovy/org/apache/bookkeeper/tests/backwardcompat/TestCompatUpgrade.groovy
@@ -43,7 +43,8 @@ class TestCompatUpgrade {
     @ArquillianResource
     DockerClient docker
 
-    private void testUpgrade(String currentlyRunning, String upgradeTo, 
boolean clientCompatBroken = false) {
+    private void testUpgrade(String currentlyRunning, String upgradeTo, 
boolean clientCompatBroken = false,
+                             boolean currentlyRunningShutsdownBadly = false) {
         String zookeeper = 
BookKeeperClusterUtils.zookeeperConnectString(docker)
         LOG.info("Upgrading from {} to {}", currentlyRunning, upgradeTo)
         int numEntries = 10
@@ -75,7 +76,18 @@ class TestCompatUpgrade {
                 }
             }
 
-            Assert.assertTrue(BookKeeperClusterUtils.stopAllBookies(docker))
+            if (currentlyRunningShutsdownBadly) {
+                // 4.6.0 & 4.6.1 can sometimes leave their ZK session alive
+                // eventually the session should timeout though
+                for (int i = 0; i < 5; i++) {
+                    if (BookKeeperClusterUtils.stopAllBookies(docker)) {
+                        break
+                    }
+                }
+                
Assert.assertTrue(BookKeeperClusterUtils.stopAllBookies(docker))
+            } else {
+                
Assert.assertTrue(BookKeeperClusterUtils.stopAllBookies(docker))
+            }
             
Assert.assertTrue(BookKeeperClusterUtils.startAllBookiesWithVersion(docker, 
upgradeTo))
 
             // check that old client can read its old ledgers on new server
@@ -166,6 +178,6 @@ class TestCompatUpgrade {
 
     @Test
     public void test460toCurrentMaster() throws Exception {
-        testUpgrade("4.6.0", System.getProperty("currentVersion"))
+        testUpgrade("4.6.0", System.getProperty("currentVersion"), false, true)
     }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to