1 |
commit: 10253819aae4cefee80f377e167ad521516d66a2 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 3 01:18:39 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 3 01:18:39 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=10253819 |
7 |
|
8 |
WriterPipeClosedTestCase: add_writer after pipe is filled |
9 |
|
10 |
Hopefully this supresses a spurious writer callback observed |
11 |
once for pypy in travis. |
12 |
|
13 |
See: https://travis-ci.org/gentoo/portage/jobs/373734825 |
14 |
|
15 |
pym/portage/tests/util/futures/asyncio/test_pipe_closed.py | 6 +++++- |
16 |
1 file changed, 5 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/pym/portage/tests/util/futures/asyncio/test_pipe_closed.py b/pym/portage/tests/util/futures/asyncio/test_pipe_closed.py |
19 |
index 1ecddab78..5398ca35c 100644 |
20 |
--- a/pym/portage/tests/util/futures/asyncio/test_pipe_closed.py |
21 |
+++ b/pym/portage/tests/util/futures/asyncio/test_pipe_closed.py |
22 |
@@ -105,7 +105,6 @@ class WriterPipeClosedTestCase(_PipeClosedTestCase, TestCase): |
23 |
|
24 |
writer_callback.called = loop.create_future() |
25 |
_set_nonblocking(write_end.fileno()) |
26 |
- loop.add_writer(write_end.fileno(), writer_callback) |
27 |
|
28 |
# Fill up the pipe, so that no writer callbacks should be |
29 |
# received until the state has changed. |
30 |
@@ -117,6 +116,11 @@ class WriterPipeClosedTestCase(_PipeClosedTestCase, TestCase): |
31 |
raise |
32 |
break |
33 |
|
34 |
+ # We've seen at least one spurious writer callback when |
35 |
+ # this was registered before the pipe was filled, so |
36 |
+ # register it afterwards. |
37 |
+ loop.add_writer(write_end.fileno(), writer_callback) |
38 |
+ |
39 |
# Allow the loop to check for IO events, and assert |
40 |
# that our future is still not done. |
41 |
loop.run_until_complete(asyncio.sleep(0, loop=loop)) |