I have some strange Pytest behaviour I can't explain and was wondering if someone had already seen this before.
So we're running Pytest with 4 treads - pytest -n 4 tests/e2e.
Now, sometimes, it runs the same test on 2 different workers, like here:
[gw1] [ 40%] PASSED tests/e2e/test_get_connector.py::test_invoke_api_with_permission_not_found
..... more tests....
[gw3] [100%] PASSED tests/e2e/test_get_connector.py::test_invoke_api_with_permission_not_found Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/jenkins/.virtualenvs/lib/python3.8/site-packages/jsii/_kernel/providers/process.py", line 284, in stop
self._process.stdin.close()
BrokenPipeError: [Errno 32] Broken pipe
You can see that the same test is run 2 times on 2 different worker threads.
The second run of that test fails with a Broken Pipe error, but the whole test run still succeeds (the second test is also marked as PASSED, as you can see) and the Jenkins job also succeeds.
Anyone has any idea why this is happening? This behaviour makes it hard to trust the pipeline..
Thanks!