You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by si...@apache.org on 2018/02/19 23:48:04 UTC

[bookkeeper] branch master updated: Handle for 4.6.0 and 4.6.1 specially in bc test shutdown

This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a8b22f  Handle for 4.6.0 and 4.6.1 specially in bc test shutdown
7a8b22f is described below

commit 7a8b22fb9f2cb0def631a0769a78968920229f7b
Author: Ivan Kelly <iv...@apache.org>
AuthorDate: Mon Feb 19 15:47:56 2018 -0800

    Handle for 4.6.0 and 4.6.1 specially in bc test shutdown
    
    There is a race in 4.6.0 and 4.6.1 which can cause the zk session to
    be leaked. The bc test should take this into account, and wait for the
    session for expire before continuing.
    
    Author: Ivan Kelly <iv...@apache.org>
    
    Reviewers: Sijie Guo <si...@apache.org>
    
    This closes #1179 from ivankelly/wait-longer
---
 .../tests/backwardcompat/TestCompatUpgrade.groovy      | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

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 7933c2f..b834e4d 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)
     }
 }

-- 
To stop receiving notification emails like this one, please contact
sijie@apache.org.