aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-02-13 18:35:03 -0800
committerZac Medico <zmedico@gentoo.org>2012-02-13 18:35:03 -0800
commit07823ba56f63309da9547e02e96b043005932be0 (patch)
treeecdfa774f9def6fb215b5c89e77312f131b14764 /pym/portage/tests/ebuild/test_ipc_daemon.py
parentEventLoop: make _poll/_run_timeouts re-entrant (diff)
downloadportage-07823ba56f63309da9547e02e96b043005932be0.tar.gz
portage-07823ba56f63309da9547e02e96b043005932be0.tar.bz2
portage-07823ba56f63309da9547e02e96b043005932be0.zip
AsynchronousTask: don't wait for exit status
Synchronous waiting for status is not supported, since it would be vulnerable to hitting the recursion limit when a large number of tasks need to be terminated simultaneously, like in bug #402335.
Diffstat (limited to 'pym/portage/tests/ebuild/test_ipc_daemon.py')
-rw-r--r--pym/portage/tests/ebuild/test_ipc_daemon.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index edfc058d7..0efab6584 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -71,8 +71,8 @@ class IpcDaemonTestCase(TestCase):
self.received_command = False
def exit_command_callback():
self.received_command = True
- proc.cancel()
- daemon.cancel()
+ task_scheduler.clear()
+ task_scheduler.wait()
exit_command.reply_hook = exit_command_callback
start_time = time.time()
@@ -80,6 +80,7 @@ class IpcDaemonTestCase(TestCase):
task_scheduler.add(proc)
task_scheduler.run(timeout=self._SCHEDULE_TIMEOUT)
task_scheduler.clear()
+ task_scheduler.wait()
hardlock_cleanup(env['PORTAGE_BUILDDIR'],
remove_all_locks=True)
@@ -108,8 +109,8 @@ class IpcDaemonTestCase(TestCase):
self.received_command = False
def exit_command_callback():
self.received_command = True
- proc.cancel()
- daemon.cancel()
+ task_scheduler.clear()
+ task_scheduler.wait()
exit_command.reply_hook = exit_command_callback
start_time = time.time()
@@ -117,6 +118,7 @@ class IpcDaemonTestCase(TestCase):
task_scheduler.add(proc)
task_scheduler.run(timeout=short_timeout_ms)
task_scheduler.clear()
+ task_scheduler.wait()
hardlock_cleanup(env['PORTAGE_BUILDDIR'],
remove_all_locks=True)