You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2007/01/18 09:14:36 UTC
svn commit: r497342 - in /incubator/qpid/trunk/qpid/python: java_failing.txt
qpid/peer.py tests/broker.py tests/queue.py
Author: gsim
Date: Thu Jan 18 00:14:36 2007
New Revision: 497342
URL: http://svn.apache.org/viewvc?view=rev&rev=497342
Log:
Modified handling of reason for closing in peer to work around race between worker and reader where a connection.close is followed by the socket closing (this is a bit of a hack).
Modified test for queue_purge to do cleanup on new connection.
Separated testing of scenario where closed channel is used from that where an unopened channel is used.
Modified:
incubator/qpid/trunk/qpid/python/java_failing.txt
incubator/qpid/trunk/qpid/python/qpid/peer.py
incubator/qpid/trunk/qpid/python/tests/broker.py
incubator/qpid/trunk/qpid/python/tests/queue.py
Modified: incubator/qpid/trunk/qpid/python/java_failing.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/java_failing.txt?view=diff&rev=497342&r1=497341&r2=497342
==============================================================================
--- incubator/qpid/trunk/qpid/python/java_failing.txt (original)
+++ incubator/qpid/trunk/qpid/python/java_failing.txt Thu Jan 18 00:14:36 2007
@@ -13,3 +13,4 @@
tests.queue.QueueTests.test_purge
tests.testlib.TestBaseTest.testMessageProperties
tests.broker.BrokerTests.test_invalid_channel
+tests.broker.BrokerTests.test_closed_channel
Modified: incubator/qpid/trunk/qpid/python/qpid/peer.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/qpid/peer.py?view=diff&rev=497342&r1=497341&r2=497342
==============================================================================
--- incubator/qpid/trunk/qpid/python/qpid/peer.py (original)
+++ incubator/qpid/trunk/qpid/python/qpid/peer.py Thu Jan 18 00:14:36 2007
@@ -129,6 +129,8 @@
self.reason = None
def close(self, reason):
+ if isinstance(reason, Message):
+ self.reason = reason
if self.closed:
return
self.closed = True
Modified: incubator/qpid/trunk/qpid/python/tests/broker.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/tests/broker.py?view=diff&rev=497342&r1=497341&r2=497342
==============================================================================
--- incubator/qpid/trunk/qpid/python/tests/broker.py (original)
+++ incubator/qpid/trunk/qpid/python/tests/broker.py Thu Jan 18 00:14:36 2007
@@ -85,14 +85,14 @@
self.assert_(msg.content.body == body)
def test_invalid_channel(self):
- other = self.connect()
- channel = other.channel(200)
+ channel = self.client.channel(200)
try:
channel.queue_declare(exclusive=True)
self.fail("Expected error on queue_declare for invalid channel")
except Closed, e:
self.assertConnectionException(504, e.args[0])
+ def test_closed_channel(self):
channel = self.client.channel(200)
channel.channel_open()
channel.channel_close()
Modified: incubator/qpid/trunk/qpid/python/tests/queue.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/tests/queue.py?view=diff&rev=497342&r1=497341&r2=497342
==============================================================================
--- incubator/qpid/trunk/qpid/python/tests/queue.py (original)
+++ incubator/qpid/trunk/qpid/python/tests/queue.py Thu Jan 18 00:14:36 2007
@@ -74,7 +74,8 @@
self.assertConnectionException(530, e.args[0])
#cleanup
- channel = self.client.channel(4)
+ other = self.connect()
+ channel = other.channel(1)
channel.channel_open()
channel.exchange_delete(exchange="test-exchange")