1 |
Author: zmedico |
2 |
Date: 2009-02-27 00:48:30 +0000 (Fri, 27 Feb 2009) |
3 |
New Revision: 12717 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/tests/process/test_poll.py |
7 |
Log: |
8 |
Fix test breakage due to change in calling order of AsynchronousTask start |
9 |
listeners from r12713. |
10 |
|
11 |
|
12 |
Modified: main/trunk/pym/portage/tests/process/test_poll.py |
13 |
=================================================================== |
14 |
--- main/trunk/pym/portage/tests/process/test_poll.py 2009-02-27 00:03:26 UTC (rev 12716) |
15 |
+++ main/trunk/pym/portage/tests/process/test_poll.py 2009-02-27 00:48:30 UTC (rev 12717) |
16 |
@@ -33,7 +33,13 @@ |
17 |
task_scheduler = TaskScheduler(max_jobs=2) |
18 |
scheduler = task_scheduler.sched_iface |
19 |
|
20 |
- producer = SpawnProcess( |
21 |
+ class Producer(SpawnProcess): |
22 |
+ def _spawn(self, args, **kwargs): |
23 |
+ rval = SpawnProcess._spawn(self, args, **kwargs) |
24 |
+ os.close(kwargs['fd_pipes'][1]) |
25 |
+ return rval |
26 |
+ |
27 |
+ producer = Producer( |
28 |
args=["bash", "-c", "echo -n '%s'" % test_string], |
29 |
fd_pipes={1:slave_fd}, scheduler=scheduler) |
30 |
|
31 |
@@ -44,10 +50,6 @@ |
32 |
task_scheduler.add(producer) |
33 |
task_scheduler.add(consumer) |
34 |
|
35 |
- def producer_start_cb(task): |
36 |
- os.close(slave_fd) |
37 |
- |
38 |
- producer.addStartListener(producer_start_cb) |
39 |
task_scheduler.run() |
40 |
|
41 |
self._assertEqual(test_string, consumer.getvalue()) |