-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use tempdir to run test to support pytest parallel #138
base: master
Are you sure you want to change the base?
Conversation
Simple example seems to work, but there's a major issue to resolve: copying the required files per test is wasteful, instead it should be the case that every test thread has their own temporary directory (so we copy once per thread). The issue here is that it doesn't seem like pytest-parallel has an API for getting the thread ID, so using Also, it would be nice to preserve the old behavior when running in a single thread. |
Also the buildkite run failed but didn't set the exit code properly for some reason, see https://buildkite.com/stanford-aha/lassen/builds/291#ca69d244-5d2e-4414-8eae-7e01ecbdf248 |
ah, the issue was that the error was occuring during test collection |
@leonardt Is there a reason we need to copy and not symlink? |
I don't think symlinking would necessarily work because the threads would then be sharing |
@cdonovick using a directory pool seems like a reasonable approach, I'm working out some kinks with the travis/buildkite builds, let me know if you need help understanding any of the test facilities, but it should be pretty clear where the tempdir stuff is and where you can replace it with your logic. |
Ok, travis/buildkite are green, seems like it's working although the stdout is a bit funky, I suspect I'm a little paranoid that we somehow borked the test logic, so it could be worth throwing some poison pills (e.g. purposefully mess up some instructions in the ALU in a separate branch) to make sure that the tests are still catching errors properly. |
Actually for travis the pytest invocation runtime dropped by ~70s which is actually decent. It's runnign less tests than buildkite (so benefits less from parallel speedup) and actually is mostly dominated by the VM setup time (travis bootup scripts, installing dependencies, etc...) |
I made a branch that munges the PE outputs, see https://github.com/StanfordAHA/lassen/blob/pytest-parallel-check-failures/lassen/sim.py#L435 |
Addresses #134