Closed cjwelborn closed 7 years ago
I'm so sorry this is causing you a problem! Green uses multiprocess internally and each process customizes the tempfile directory location so that code being tested that uses temp files won't ever have collisions (so long as the tempfile module is being used).
So...there's a bunch of things that could be interacting with your problem. I'll dig into it as soon as I can and see if I can figure out what's going on.
Awesome, thanks for taking the time. :smile: I'll probably dig into it a little bit more just in case I missed something.
@CleanCut, thanks for taking care of this. What's the release schedule for green
as far as PyPi (pip
) is concerned? I was wondering when I should start looking to upgrade to 2.7.1
.
ASAP. I try to always add a comment to each issue stating the release it has been fixed in. I'm dealing with flaky pypy builds on Travis. If it fails one more time, I'm going to move pypy over to the "ignore" section. There's something wrong with pypy on Travis. It just randomly fails when multiprocessing in random places -- but always with a timeout, which is something I've never been able to replicate on any real machine.
That was quick. Re-running the pypy build passed for now, so it is spared a little while longer.
The fix for this issue is in 2.7.1.
@CleanCut, awesome :smile: . Already installed and tests are passing! Thanks again for the fix.
No problem! I don't like bugs. They ought to be squashed. ;-)
I'm testing a subclass of
multiprocessing.Process
, using amultiprocessing.Value
to share some values with the caller of the process. All of the other test runners can run these tests with no problem (nose
,py.test
), but if I run them withgreen
I'm getting aFileNotFoundError
. It looks like there is some cleanup of/tmp
files happening twice, but I'm not sure about that. Here is the minimum code required to produce this error:The process is never started. Just initializing it will cause this. Here is the output I am getting:
I've tried patching
multiprocessing.util._run_finalizers
, or just catching badFinalize
objects frommultiprocessing.util._finalizer_registry
andcancel()
ing them, but I can't seem to catch it in time. I don't know exactly where thisFinalize
callback is being created or called when running this test throughgreen
. I can inspect theFinalize
objects/callbacks duringsetUp
,tearDown
, or while the test is running (in the method body, before or after initializing theProcess
), and I see a few callbacks, but none with the filename/address that is being reported as "not found". If I could find it, then I couldcancel
it.Anyway, I thought maybe someone else might know more about what's going on here, or how to fix it. I really like using
green
. Thanks for creating/maintaining it :smile:. Hopefully there is a simple fix/workaround for this.P.S. - I've been debugging multi-process stuff (communication mainly) in my own little project for a while now, hence the need for tests, and wrapping my stuff in
unittest
orgreen
's multi-process stuff and then trying to debug this error is giving me a headache :face_with_head_bandage:. Thank you for any pointers you can give me about this little problem.Green Version:
2.7.0
Python Version:3.5.2