test_amqp_log_source randomly failing
Bug #922017 reported by
beatpanic
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
Medium
|
Anton Gritsay |
Bug Description
When running ./run_tests -x on ubuntu 11.10 I get randomly this test failing
=======
FAIL: test_amqp_
-------
Traceback (most recent call last):
File "/home/
self.
AssertionError: 0 != 1
-------
Changed in openquake: | |
status: | New → Confirmed |
Changed in openquake: | |
assignee: | nobody → Anton Gritsay (angri) |
Changed in openquake: | |
milestone: | none → 0.5.1 |
Changed in openquake: | |
status: | In Progress → Fix Committed |
Changed in openquake: | |
importance: | Undecided → Medium |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
That seems to happen because of longer round trip time "python - amqp - python". This should solve the problem even for slower machines:
diff --git a/tests/ logs_unittest. py b/tests/ logs_unittest. py logs_unittest. py logs_unittest. py stCase( unittest. TestCase) : on_timeout:
raise StopIteration()
index a9977b3..87981ce 100644
--- a/tests/
+++ b/tests/
@@ -274,9 +274,8 @@ class PythonAMQPLogTe
if self.stop_
- logsource = _AMQPLogSource( 'oq.testlogger. #', timeout=0.1) 'oq.testlogger. #', timeout=1.0)
logsource_ thread = threading. Thread( target= logsource. run) thread. start() handlers. BufferingHandle r(float( 'inf')) getLogger( 'oq.testlogger' )
logger. addHandler( handler) stCase( unittest. TestCase) :
self. producer. publish( msg.copy( ),
routing_ key='oq. testlogger. sublogger' ) thread. start()
timeout. wait()
timeout. clear()
+ logsource = _AMQPLogSource(
- logsource_
handler = logging.
logger = logging.
@@ -294,6 +293,7 @@ class PythonAMQPLogTe
)
+ logsource_
# raising minimum level to make sure that info message