Skip to content

Commit

Permalink
[FIX] tests race condition in phanthomjs tests
Browse files Browse the repository at this point in the history
A deadlock occurs when
- phantomjs_test1 is executedd, enter_test_mode is activated
- console.log('ok') is issued, sigterm is sent to phantomjs_test1 process
- phantomjs_test1 is finished and leave_test_mode restores the registrymanager lock
- phantomjs_test1 process, just before dying, makes a last http request phantomjs_test1_last_request
- phantomjs_test1_last_request thread will wait for the registrymanager lock, when all tests will be completed 
- phantomjs_test2 is run, enter_test_mode is activated
- phantomjs_test2 is reach its end and _wait_remaining_requests is called
- phantomjs_test2 _wait_remaining_requests hangs forever waiting for phantomjs_test1_last_request

bzr revid: al@openerp.com-20140501150641-ua0b7pntesgm3n5p
  • Loading branch information
antonylesuisse committed May 1, 2014
1 parent abbe08f commit 739793c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openerp/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def phantom_run(self, cmd, timeout):
# kill phantomjs if phantom.exit() wasn't called in the test
if phantom.poll() is None:
phantom.terminate()
phantom.wait()
self._wait_remaining_requests()
_logger.info("phantom_run execution finished")

Expand Down

0 comments on commit 739793c

Please sign in to comment.