armi icon indicating copy to clipboard operation
armi copied to clipboard

Tests are leaving empty temp dirs around on Linux

Open john-science opened this issue 1 year ago • 1 comments

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 avatar Jul 15 '24 22:07 john-science

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:

https://github.com/terrapower/armi/blob/d0092e8b022c593e341c09cecb4f597687222417/armi/init.py#L350-L352

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.

ntouran avatar Jul 16 '24 12:07 ntouran