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
iptest: Use a temporary directory for IPYTHONDIR #1888
Conversation
return os.system(' '.join(self.call_args)) | ||
with TemporaryDirectory() as IPYTHONDIR: | ||
return os.system(' '.join(['IPYTHONDIR=%s' % IPYTHONDIR] + | ||
self.call_args)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have NOT tested this in Windows, so this may, or may not, actually work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't using an env
dict as we do on other platforms work more reliably? We should be able to use subprocess.call
in place of os.system
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the full comment, which you can't see in this diff view:
# On Windows, use os.system instead of subprocess.call, because I
# was having problems with subprocess and I just don't know enough
# about win32 to debug this reliably. Os.system may be the 'old
# fashioned' way to do it, but it works just fine. If someone
# later can clean this up that's fine, as long as the tests run
# reliably in win32.
# What types of problems are you having. They may be related to
# running Python in unboffered mode. BG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think unbuffered mode was something we needed when we were still using twisted, so maybe that's not applicable any more. We really need more Windows testers for things like this. Let's cook up something we think should work, then ping jstenar to test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to look into obtaining a reliable and persistent Windows box we can all log into remotely so we can once and for all have more solid Windows testing and access to easier debugging on Windows as needed. Stay tuned, though do go ahead on this with @jstenar as well in the meantime. It also occurred to me that @jdmarch might have access to Windows testing, any chance you know what to do here, Jonathan?
A few comments, mostly in the context of Windows. Wish I had a clear & full response but I am out of time tonight, mostly offline for the next week, and probably out of time for the week after that.
|
OK, so by the sounds of it we should try changing it to |
That could be done, and we can ask @jstenar to have a test of the branch on Windows as well... |
Well, to really get the ball rolling here I've removed the windows os.system call and run the different test groups in their own processes using Now this is pretty wasteful. By that, I mean multiprocessing spins up a fresh Python process to run 'runner.run()' which then launches a new Python process for the actual test.
But it does cut the test time down to ~56 seconds (from ~136 seconds). |
That looks like pretty good progress! I'm going to tag this as 0.14 material though, because it makes pretty serious changes that I'm not comfortable with this close to release time... |
On WinXP-32, test IPython.core has a failure with this PR, but not with PR #2016, and not when run freestanding.
|
On WinXP-32, test IPython.zmq freezes during post-test cleanup with this PR, but not with PR #2016, and not when run freestanding. Possible segfault (eventually the Windows error reporting dialog pops up). Leaves many python processes alive but nothing responsive.
|
Thanks for those tests, @jdmarch! This is 0.14 material, so there's no danger of introducing instability for the release, but having this feedback is excellent so we can get this one in good shape. |
This pull request is too unwieldy. I'm going to parcel it out into a few distinct pull requests, beginning with #2148: "win32 iptest: Use subprocess.Popen() instead of os.system()." |
Great thanks! |
Begin working on #1880 (Add parallelism to iptest & test_pr) by using a temporary directory for IPYTHONDIR for each IPython test group.