PROTON-1280: Fix Messenger Selectable test
- I hate this kind of fix!
- We now have a very short time out in select instead of 0 timeout
(polling behaviour) so that we don't finish if it takes a little time to
receive an end of stream on one of our sockets.
- It seems that on Linux you reliably get the end of stream on the select()
call immediately after closing the socket at the other end locally
- But on FreeBSD you usually don't get the EOS immediately, you need to enter
the kernel first: this was causing the test to fail on FreeBSD.
diff --git a/tests/python/proton_tests/messenger.py b/tests/python/proton_tests/messenger.py
index 9656033..8e2251a 100644
--- a/tests/python/proton_tests/messenger.py
+++ b/tests/python/proton_tests/messenger.py
@@ -970,7 +970,7 @@
if sel.writing:
writing.append(sel)
- readable, writable, _ = select(reading, writing, [], 0)
+ readable, writable, _ = select(reading, writing, [], 0.1)
count = 0
for s in readable:
@@ -984,7 +984,6 @@
def pump(self):
while self.pump_once(): pass
-
class SelectableMessengerTest(common.Test):
def testSelectable(self, count = 1):