terrapower / armi

An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality
https://terrapower.github.io/armi/
Apache License 2.0
212 stars 82 forks source link

Get unit tests working in parallel on MacOS #1714

Closed john-science closed 1 week ago

john-science commented 1 month ago

On GitHub CI, the unit tests are being run in serial on MacOS, but they would run faster if they were in parallel. So I would like to change this:

https://github.com/terrapower/armi/blob/86247a9f763949f802d32ff1f36beca6aa01292d/.github/workflows/mac_tests.yaml#L28

To this:

pytest -n 4 armi

But the problem is something about our temp directory logic breaks in that case. You can see an example of the failures we will get here:

FileNotFoundError: [Errno 2] No such file or directory:
'/Users/runner/.armi/0gw2-20240430163151890323/
temp-2kJs778dQX/test_overwriteSettingsCorrectiveQuery_test_setting_io_old.yaml'
john-science commented 2 weeks ago

@drewejohnson @albeanth Both of you are Mac people, right?

Any ideas?

albeanth commented 1 week ago

I just tested running the unit tests in parallel on my Mac and they work. I ran pytest -n 2 armi and pytest -n 4 armi, both work.

Maybe this is more of a GH actions issue?

john-science commented 1 week ago

I just tested running the unit tests in parallel on my Mac and they work. I ran pytest -n 2 armi and pytest -n 4 armi, both work.

Maybe this is more of a GH actions issue?

Thanks!

I have a PR up. Yeah, the problem that was popping up on GitHub Actions was also popping up for Arrielle on Windows if she run with -n 8 or higher.

I eventually found the runLog.py fix in my PR that solved all problems.

Thanks for looking at it!