You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2019/02/06 16:52:30 UTC
[qpid-proton] branch master updated: NO-JIRA: Fix sec to millis
comparison in proton_tests/reactor.py
This is an automated email from the ASF dual-hosted git repository.
aconway pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/master by this push:
new f70572e NO-JIRA: Fix sec to millis comparison in proton_tests/reactor.py
f70572e is described below
commit f70572e139a1676a08935dd3ea24f8188e058753
Author: Alan Conway <ac...@redhat.com>
AuthorDate: Wed Feb 6 11:51:22 2019 -0500
NO-JIRA: Fix sec to millis comparison in proton_tests/reactor.py
---
python/tests/proton_tests/reactor.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/python/tests/proton_tests/reactor.py b/python/tests/proton_tests/reactor.py
index 7d6b689..907f1fc 100644
--- a/python/tests/proton_tests/reactor.py
+++ b/python/tests/proton_tests/reactor.py
@@ -229,7 +229,7 @@ class ExceptionTest(Test):
assert len(Nothing.results) == 0
def test_schedule_cancel(self):
- barf = self.container.schedule(60, BarfOnTask())
+ barf = self.container.schedule(10, BarfOnTask())
class CancelBarf:
def __init__(self, barf):
self.barf = barf
@@ -237,11 +237,11 @@ class ExceptionTest(Test):
self.barf.cancel()
pass
self.container.schedule(0, CancelBarf(barf))
- now = self.container.mark()
+ start = time.time()
try:
self.container.run()
- elapsed = self.container.mark() - now
- assert elapsed < 60, "should have cancelled immediately, took %ss" % elapsed
+ elapsed = time.time() - start
+ assert elapsed < 10, "should have cancelled immediately, took %ss" % elapsed
except Barf:
assert False, "expected barf to be cancelled"
@@ -259,10 +259,10 @@ class ExceptionTest(Test):
pass
self.container.schedule(0, CancelBarf(barf))
barfs.add(barf)
- now = self.container.mark()
+ start = time.time()
try:
self.container.run()
- elapsed = self.container.mark() - now
+ elapsed = time.time() - start
assert elapsed < num, "expected cancelled task to not delay the reactor by %s" % elapsed
assert not barfs, "expected all barfs to be discarded"
except Barf:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org