diff options
| author | Alan Conway <aconway@apache.org> | 2012-07-13 18:33:32 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-07-13 18:33:32 +0000 |
| commit | db093e45ef7ecf327d01e8b264373a450cd31c60 (patch) | |
| tree | 2146ee04f25aa30094abf906ecd7912b31ee285c /cpp | |
| parent | e1b10df21d0ccf0705935c053e11a6f97df91785 (diff) | |
| download | qpid-python-db093e45ef7ecf327d01e8b264373a450cd31c60.tar.gz | |
QPID-4136: HA sporadic failures in ha_tests
Caused by a test bug, default timeout was too short.
Fixed the test to set a high timeout and increased default timeout.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1361323 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/src/qpid/ha/Settings.h | 2 | ||||
| -rwxr-xr-x | cpp/src/tests/ha_tests.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/ha/Settings.h b/cpp/src/qpid/ha/Settings.h index 1a612aee66..37235b5c79 100644 --- a/cpp/src/qpid/ha/Settings.h +++ b/cpp/src/qpid/ha/Settings.h @@ -34,7 +34,7 @@ namespace ha { class Settings { public: - Settings() : cluster(false), replicateDefault(NONE), backupTimeout(2) + Settings() : cluster(false), replicateDefault(NONE), backupTimeout(5) {} bool cluster; // True if we are a cluster member. diff --git a/cpp/src/tests/ha_tests.py b/cpp/src/tests/ha_tests.py index 01dac2664d..f900a841d5 100755 --- a/cpp/src/tests/ha_tests.py +++ b/cpp/src/tests/ha_tests.py @@ -857,7 +857,8 @@ class RecoveryTests(BrokerTest): """Verify that the broker holds queues without sufficient backup, i.e. does not complete messages sent to those queues.""" - cluster = HaCluster(self, 4); + # We don't want backups to time out for this test, set long timeout. + cluster = HaCluster(self, 4, args=["--ha-backup-timeout=100000"]); # Wait for the primary to be ready cluster[0].wait_status("active") # Create a queue before the failure. @@ -877,6 +878,7 @@ class RecoveryTests(BrokerTest): # Create a queue after the failure s2 = cluster.connect(3).session().sender("q2;{create:always}") + # Verify that messages sent are not completed for i in xrange(100,200): s1.send(str(i), sync=False); s2.send(str(i), sync=False) assertSyncTimeout(s1) @@ -886,6 +888,7 @@ class RecoveryTests(BrokerTest): # Verify we can receive even if sending is on hold: cluster[3].assert_browse("q1", [str(i) for i in range(100)+range(100,200)]) + # Restart backups, verify queues are released only when both backups are up cluster.restart(1) assertSyncTimeout(s1) @@ -895,6 +898,7 @@ class RecoveryTests(BrokerTest): self.assertEqual(cluster[3].ha_status(), "recovering") cluster.restart(2) + # Verify everything is up to date and active def settled(sender): sender.sync(); return sender.unsettled() == 0; assert retry(lambda: settled(s1)), "Unsetttled=%s"%(s1.unsettled()) assert retry(lambda: settled(s2)), "Unsetttled=%s"%(s2.unsettled()) |
