diff options
| author | Alan Conway <aconway@apache.org> | 2012-04-16 19:19:55 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-04-16 19:19:55 +0000 |
| commit | 1c86a148e644b8ce5ae8cf08a70369b0609c1b27 (patch) | |
| tree | 88028caa9b278532b0a5c734628ad35ba4cb45f3 /cpp | |
| parent | 5d2822f4d3636cafb1e4203188bffcafc32cc62e (diff) | |
| download | qpid-python-1c86a148e644b8ce5ae8cf08a70369b0609c1b27.tar.gz | |
QPID-3603: ha_tests.py: Suppress python WARNING messages during failover
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1326753 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
| -rwxr-xr-x | cpp/src/tests/ha_tests.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/cpp/src/tests/ha_tests.py b/cpp/src/tests/ha_tests.py index a9771350aa..740b695278 100755 --- a/cpp/src/tests/ha_tests.py +++ b/cpp/src/tests/ha_tests.py @@ -26,7 +26,7 @@ from threading import Thread, Lock, Condition from logging import getLogger, WARN, ERROR, DEBUG from qpidtoollibs import BrokerAgent -log = getLogger("qpid.ha-tests") +log = getLogger(__name__) class HaBroker(Broker): def __init__(self, test, args=[], broker_url=None, ha_cluster=True, @@ -44,6 +44,7 @@ class HaBroker(Broker): Broker.__init__(self, test, args, **kwargs) self.commands=os.getenv("PYTHON_COMMANDS") assert os.path.isdir(self.commands) + getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. def promote(self): assert os.system("%s/qpid-ha promote -b %s"%(self.commands, self.host_port())) == 0 @@ -145,8 +146,6 @@ class ReplicationTests(HaTest): """Test basic replication of configuration and messages before and after backup has connected""" - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. - def queue(name, replicate): return "%s;{create:always,node:{x-declare:{arguments:{'qpid.replicate':%s}}}}"%(name, replicate) @@ -256,7 +255,6 @@ class ReplicationTests(HaTest): def test_send_receive(self): """Verify sequence numbers of messages sent by qpid-send""" brokers = HaCluster(self, 3) - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. sender = self.popen( ["qpid-send", "--broker", brokers[0].host_port(), @@ -280,7 +278,6 @@ class ReplicationTests(HaTest): def test_failover_python(self): """Verify that backups rejects connections and that fail-over works in python client""" - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. primary = HaBroker(self, name="primary", expect=EXPECT_EXIT_FAIL) primary.promote() backup = HaBroker(self, name="backup", broker_url=primary.host_port()) @@ -351,7 +348,6 @@ class ReplicationTests(HaTest): def test_standalone_queue_replica(self): """Test replication of individual queues outside of cluster mode""" - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. primary = HaBroker(self, name="primary", ha_cluster=False) pc = primary.connect() ps = pc.session().sender("q;{create:always}") @@ -378,7 +374,6 @@ class ReplicationTests(HaTest): def test_queue_replica_failover(self): """Test individual queue replication from a cluster to a standalone backup broker, verify it fails over.""" - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. cluster = HaCluster(self, 2) primary = cluster[0] pc = cluster.connect(0) @@ -426,7 +421,6 @@ class ReplicationTests(HaTest): def test_reject(self): """Test replication with the reject queue policy""" - getLogger().setLevel(ERROR) # Hide expected WARNING log messages from failover. primary = HaBroker(self, name="primary") primary.promote() backup = HaBroker(self, name="backup", broker_url=primary.host_port()) |
