Skip to content
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

Tests are leaving empty temp dirs around on Linux #1780

Open
john-science opened this issue Jul 15, 2024 · 1 comment
Open

Tests are leaving empty temp dirs around on Linux #1780

john-science opened this issue Jul 15, 2024 · 1 comment
Labels
cleanup Code/comment cleanup: Low Priority good first issue Good for newcomers testing Related to tests

Comments

@john-science
Copy link
Member

After the unit tests run (even if they pass successfully, empty temp dirs are being left around:

$ ls ~/.armi/
0wg1-2024071536823796283756293752/
0wg1-2024071536823796283326236423/
0wg2-2024071536823796226263623623/
0wg2-2024071536823796283756623623/

I imagine this is happening due to some logic not working on Linux in TemporaryDirectoryChanger.

NOTE: I can reproduce this bug on various Linux distros, but not on Windows.

@john-science john-science added cleanup Code/comment cleanup: Low Priority testing Related to tests labels Jul 15, 2024
@ntouran
Copy link
Member

ntouran commented Jul 16, 2024

Those kinds of files can be left around when a test fails and the cleanup steps don't work. There is a big platform-dependent difference between how cleanup gets triggered after ctrl-c aborts based on signals which may be causing this:

armi/armi/__init__.py

Lines 350 to 352 in d0092e8

if os.name == "nt":
signal.signal(signal.SIGBREAK, _cleanupOnCancel)
signal.signal(signal.SIGINT, _cleanupOnCancel)

Contextual sidenote: the ~/.armi dir is made in $HOME on linux (aka ~), but it should be identically made in Windows, generally in %USERPROFILE%, which I think is more like C:\users\[username]\AppData\armi or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code/comment cleanup: Low Priority good first issue Good for newcomers testing Related to tests
Projects
None yet
Development

No branches or pull requests

2 participants