Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ChildWatcher.rstatus #8

Merged
merged 1 commit into from
Dec 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions known_failures.patch
Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
--- known_failures.py 2015-06-28 14:33:12.270911380 +0100
+++ known_failures.py 2015-06-28 14:33:04.303661343 +0100
@@ -107,6 +107,26 @@
@@ -107,6 +107,16 @@
FLAKY test__socket.py
'''.strip().split()

+FAILING_TESTS += '''
+ test__subprocess_poll.py
+ test_close_backend_fd.py
+ test_hub_join_timeout.py
+ test__example_udp_client.py
+ test_hub_join.py
+ test__subprocess.py
+ test_threading_2.py
+ test__destroy.py
+ test__server.py
+ test__doctests.py
+ test__core_stat.py
+ test__example_portforwarder.py
+ test__example_udp_server.py
+ test__environ.py
+'''.strip().split()
+
+if os.environ.get('GEVENT_FILE') == 'thread' or os.environ.get('GEVENT_RESOLVER') == 'thread':
+ FAILING_TESTS += 'FLAKY test__examples.py'
+

if __name__ == '__main__':
Expand Down
11 changes: 9 additions & 2 deletions tulipcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(self, loop, pid, ref=True):
super().__init__(loop, ref=ref)
self.pid = pid
self.watcher = self.loop.policy.get_child_watcher()
self.rcode = None
self.rstatus = None
self.rpid = None

def _start(self):
Expand All @@ -190,8 +190,15 @@ def _stop(self):
self.watcher.remove_child_handler(self.pid)

def _invoke_wrapper(self, pid, retcode):
# asyncio messes with the status code value, go up the stack and get it
try:
outer_frame = sys._getframe(1)
status = outer_frame.f_locals['status']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status is not always present in upper stack - would better if we can reverse the "mess"

finally:
del outer_frame

self.rpid = pid
self.rcode = retcode
self.rstatus = status
self._invoke()


Expand Down