summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-08-18 07:37:29 +0000
committerBenny Prijono <bennylp@teluu.com>2010-08-18 07:37:29 +0000
commit69049b69c8ce3413404af85c52698a5fe87a3b8a (patch)
tree8b5cfdfc8ea08739a6da7f126a74ed228d03b5c8 /tests
parentb927886d54abc80550ea8632f185960696f11b03 (diff)
Misc (re #1110): fixed bug in the python unit test that caused tests to run for much longer than needed because it unnecessarily waits for incoming message until timeout occurs
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3283 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests')
-rw-r--r--tests/pjsua/inc_sip.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/pjsua/inc_sip.py b/tests/pjsua/inc_sip.py
index 9797941f..f7e64816 100644
--- a/tests/pjsua/inc_sip.py
+++ b/tests/pjsua/inc_sip.py
@@ -165,10 +165,10 @@ class Dialog:
msg = ""
src_addr = None
while time.time() < endtime:
- readset = select([self.sock], [], [], timeout)
+ readset = select([self.sock], [], [], 1)
if len(readset[0]) < 1 or not self.sock in readset[0]:
if len(readset[0]) < 1:
- print "select() timeout"
+ print "select() timeout (will wait for " + str(int(endtime - time.time())) + "more secs)"
elif not self.sock in readset[0]:
print "select() alien socket"
else:
@@ -176,6 +176,7 @@ class Dialog:
continue
try:
msg, src_addr = self.sock.recvfrom(4096)
+ break
except:
print "recv() exception: ", sys.exc_info()[0]
continue