-
Notifications
You must be signed in to change notification settings - Fork 232
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
Document that writing to stdout/stderr does not work on workers #82
Comments
Why is this the case? I understand the motivation for remote runs over ssh where stdout/stderr would have to be serialized and communicated back. But what about local runs (i.e. |
no, execnet uses stdin/out for communication |
I see. Would adding explicit support be hard (in theory)? If you think it wouldn't require any insane refactors I would like to give it a try. print() and log handlers which just dumps stuff on stdout/stderr is such an obvious and easy way to get some debug output. I wrestle with some hard-to-debug intermittent failures on our CI server where I cannot just disable xdist because of slowness. (I tried to redirect my log messages to some temporary files, but I found it not really straightforward to get that working either, with different nodes etc.) |
a python only solution is thinkable (it just needs a handler for stdin/out) |
(I have not gotten around to do anything about this yet, if anyone is interested, feel free to tackle this!) |
If execnet uses I know, for example, that |
Though I guess one could always resort to printing to def pytest_sessionfinish(session, exitstatus):
workerinput = getattr(session.config, 'workerinput', None)
if workerinput is None:
print("\nExiting the Master Process, or running serially", file=sys.__stderr__)
else:
print(f"\nExiting Worker: {workerinput['workerid']}\n", file=sys.__stderr__) |
In my scenario, |
No description provided.
The text was updated successfully, but these errors were encountered: