IpcDaemonTestCase: init start_time earlier
authorZac Medico <zmedico@gentoo.org>
Thu, 9 Feb 2012 00:46:02 +0000 (16:46 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 9 Feb 2012 00:46:02 +0000 (16:46 -0800)
Since commit 4620d6aba1c5c10344e311585516ee43819b703c, the
SequentialTaskQueue.add() method starts the task immediately, so
initialize start_time before that happens.

pym/portage/tests/ebuild/test_ipc_daemon.py

index c638437921b6f2a2f3f1c4e0f6b88487451101aa..edfc058d7e2a93f87b9c0c43d8cdb9508bcc4547 100644 (file)
@@ -75,9 +75,9 @@ class IpcDaemonTestCase(TestCase):
                                        daemon.cancel()
 
                                exit_command.reply_hook = exit_command_callback
+                               start_time = time.time()
                                task_scheduler.add(daemon)
                                task_scheduler.add(proc)
-                               start_time = time.time()
                                task_scheduler.run(timeout=self._SCHEDULE_TIMEOUT)
                                task_scheduler.clear()
                                hardlock_cleanup(env['PORTAGE_BUILDDIR'],
@@ -112,9 +112,9 @@ class IpcDaemonTestCase(TestCase):
                                        daemon.cancel()
 
                                exit_command.reply_hook = exit_command_callback
+                               start_time = time.time()
                                task_scheduler.add(daemon)
                                task_scheduler.add(proc)
-                               start_time = time.time()
                                task_scheduler.run(timeout=short_timeout_ms)
                                task_scheduler.clear()
                                hardlock_cleanup(env['PORTAGE_BUILDDIR'],