I have a rather large test base that takes around 30min to run on my local computer.
I'm trying to run this in a pipeline. In principle everything works fine, if I run some tests via pytest they pass and the pipeline ends.
If I try to run all tests the pipeline hangs and does not end. This means that there is no more output from the pipeline. The time of the pipeline itself is still counting (updates from time to time), but no new output is shown and the time of the command in the step does not updated anymore.
The place of the hang is deterministic and depends on the output of pytest. More output means an earlier hang:
- This invocation gets me to around 36% of the tests when the pipeline hangs.
pytest -rfE -l --tb=short --disable-warnings --junitxml="./test-results/results.xml" --log-level=ERROR
The output lists every test, whether it passes or not and logged errors, if any:
<span>tests/test_BadPerformanceFilter.py::test_BadPerformanceFilter_should_remove_assets_with_bad_performance[quant=9-cat=4-max_cat=100-parallel:True] PASSED [ 3%]<br>...<br></span><span>...<br>tests/test_BadPerformanceFilter.py::test_BadPerformanceFilter_should_remove_assets_with_bad_performance[quant=9-cat=4-max_cat=100-parallel:False] PASSED [ 2%]<br></span>
- If I change the displayed logging to"no logging" and keep the rest the same, this takes me to 92% before the hang:
pytest -rfE -l --tb=short --disable-warnings --junitxml="./test-results/results.xml" -p no:logging
The output is significantly shorter, since not every test is named:
<span><a href="https://bitbucket.org/lloydfonds/algo/src/26a12353508a67b2221197ee429986a4032af05b/tests/datasrc_tests/test_depot_data.py" target="_blank" rel="noopener noreferrer"><br>tests/datasrc_tests/test_depot_data.py</a> .s... [ 92%]<br></span><span><a href="https://bitbucket.org/lloydfonds/algo/src/26a12353508a67b2221197ee429986a4032af05b/tests/datasrc_tests/test_returns_data.py" target="_blank" rel="noopener noreferrer">tests/datasrc_tests/test_returns_data.py</a> ...E.. [ 92%]<br></span><span><a href="https://bitbucket.org/lloydfonds/algo/src/26a12353508a67b2221197ee429986a4032af05b/tests/forecast_tests/test_returnsforecast.py" target="_blank" rel="noopener noreferrer">tests/forecast_tests/test_returnsforecast.py</a> . [ 92%]</span><span><a href="https://bitbucket.org/lloydfonds/algo/src/26a12353508a67b2221197ee429986a4032af05b/tests/datasrc_tests/test_asset_properties_global.py" target="_blank" rel="noopener noreferrer">...<br>tests/datasrc_tests/test_asset_properties_global.py</a> ..... [ 92%]</span>
When the pipeline hangs, the duration of the pytest call is not updated anymore, while the time for the whole pipeline is updated from time to time.
If I remove enough tests from the test run, everything works. If I run the removed tests by themselves, it works too.
When I run the tests in a local Docker container (https://community.atlassian.com/t5/Bitbucket-questions/How-can-I-debug-my-Bitbucket-Pipelines-build-locally/qaq-p/136594) all tests run an the testsuite ends.
Any help would be appreciated.
Thanks!