[00:18:54] <dstufft> nothing else interesting happens after rmtree is called, except for... https://github.com/pypa/pip/blob/develop/pip/basecommand.py#L137-L185
[00:19:02] <dstufft> this is all happening inside of that self.run() call
[00:19:45] <dstufft> after rmtree is called, an integer is decremented, return statement, and if statement that evaluates to false, then the def run() returns
[00:44:03] <dstufft> Alex_Gaynor: https://github.com/pypa/pip/pull/1880/files#diff-b670e3b192038c9ffe810c1a12c0c51fR140 uncommenting that == test failure, commenting it == hangs
[00:44:27] <Alex_Gaynor> so... something to do with blocking pipes and buffer sizes... I guess?
[00:45:03] <dstufft> this is without subprocess.PIPE
[23:12:15] <dstufft> https://github.com/pypa/scripttest/blob/master/scripttest.py#L242-L260 is the code btw, debug = True, no blocking, debug = False, blocks forever (or well 10 minutes at which point travis kills the test)
[23:14:09] <dstufft> for this one particular test, it's blocked everytime I had debug = False, and the test fails past the communicate call with debug = True, only on python 3.2 though
[23:14:30] <dstufft> it's an unrelated change to what this test tests though
[23:14:50] <dstufft> there was a different one yesterday with similiar circmunstances, except it was only python 3.3
[23:14:57] <dstufft> and a different set of changes
[23:15:13] <glyph> okay I thought you were talking about something intermittent
[23:15:18] <glyph> maybe this is not what I thought
[23:15:58] <dstufft> fwiw yesterady I shoved print statements everywhere and it got to the point where a print right before sys.exit(0) would be printed, and then nothing
[23:16:09] <dstufft> os._exit(0) did of course force it to exit
[23:17:33] <glyph> well, let's not be hasty, "of course" is a bit strong
[23:19:04] <dstufft> sorry I forgot we were dealing with computers
[23:19:39] <glyph> but okay it does cause the exit, which means you can narrow down things a bit to something the *subprocess* is doing
[23:19:45] <glyph> which means the subprocess module likely _isn't_ at fault
[23:20:03] <glyph> and we're seeing hangs on Linux and OS X but _not_ on Windows
[23:20:22] <dstufft> well, no reported hangs, but we don't run CI on Windows
[23:20:29] <dstufft> so it's more of a we don't know
[23:20:50] <glyph> dstufft: which test is it, what script is it?
[23:21:35] <dstufft> right now it's this test -> https://github.com/pypa/pip/blob/develop/tests/functional/test_install_config.py#L20-L38
[23:21:54] <dstufft> with this change https://github.com/pypa/pip/pull/1882 (it doesn't fail w/o this change)
[23:22:28] <dstufft> yesterday it was this test -> https://github.com/pypa/pip/blob/develop/tests/functional/test_freeze.py#L279-L306 with this change https://github.com/pypa/pip/pull/1878
[23:24:23] <dstufft> the only change to today's code is wrapping stuff in a context manager that closes requests's session (and thus the TCP connections) but doesn't change any of the code inside of the context managers
[23:25:10] <glyph> dstufft: so perhaps I should state the obvious first: subprocess.communicate() is a bad thing to run in a test, because if the subprocess fails to exit, it's game over
[23:25:39] <dstufft> is there a better way to test the output of a sub process?
[23:26:12] <dstufft> 1/2 of pip's test suite is "create a virtual env, install pip into it, run some pip commands, assert stuff about the output and/or state of the virtual env"
[23:26:35] <dstufft> this sucks, but it's an ongoing thing to move more of our testing to unit tests
[23:27:59] <glyph> dstufft: this is why twisted is in fact a good idea. Real subprocess I/O does have the risk of a hang, but you want to receive output incrementally so that you can notice if, for example, you see a traceback in your stderr and just exit
[23:28:25] <glyph> I don't think there's a way of doing evented I/O to a subprocess normally
[23:29:55] <dstufft> the docs says communicate() uses select on unix and threads on Windows, but idk more than that
[23:30:47] <dstufft> I have to run out for a few minutes, do you mind if we finish this in a little bit glyph ?
[23:30:49] <glyph> dstufft: the thing is, it uses select() to interleave stdin and stdout
[23:31:14] <glyph> dstufft: I am going to be leaving pretty soon but I should have plenty of time tomorrow in the afternoon