-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Green leaves empty temp files in /tmp #228
Comments
I have just found that the temp dirs are intentionally not removed by the poolRunner when the Python 3 is detected. Also found one older attempt to fix this here #173. If that is problem of macOS why not narrow the condition skipping temp removal for macOS only? Leaving thousands of empty temp directories after multiple runs of the tests is somewhat annoying... |
…eaks many versions of Python 3 on Linux and macOS. This reverts commit 14d360b.
@lcerman It's extremely annoying. Unfortunately, it's also disturbingly hard to fix. I've spent days on this in the past. Take a look at what happens if I just try to naively clean up files and ignore errors --> 💥 ... and not just on macOS. Perhaps it just needs a fresh pair of eyes! Would you like to give it a try? We all have our blind spots, so maybe you'll find a way that I missed. If you fork and make a PR, any commit you push to your fork should trigger CI on TravisCI and AppVeyor so you can see whether anything breaks or not. |
Finally, I am back with a solution: #232 The solution is pragmatic -- rather than trying to remove the temp-dirs in the workers a single temp-dir is created by the main function. The workers continue to create their own temps as sub-directories of the main temp, which is then removed when the main function finishes. |
Awesome! Thank you so much. That's a nice solution. |
The fix is included in 3.2.3, just released. |
After running green an empty tmpdir remain in /tmp for each test file executed. E.g., if I have project with 10 test files, 10 empty directories remains after running green. In a larger project it soon reaches thousands of empty directories in tmp after a while...
Steps to reproduce:
green testfile.py
An empty tmp* directory is left in /tmp.
Our green config file:
Note: when running the test with standard unittest module no empty dir remains, it seems to be issue of green not unittest module.
The text was updated successfully, but these errors were encountered: