-
- Downloads
Fork new test processes sparingly
The test suite of this project is quite extensive, and it can take a
while to run all the tests in the suite. Forking a new process for each
of these executions is an extra cost, and therefore it makes sense to
avoid it when possible. While forking is unavoidable for tests requiring
Tango devices to be started, the rest of the tests (most of them) do not
have this requirements and therefore can be run without forking.
This commit changes the default behavior of all tests to not fork, and
marks those classes containing Tango-dependent tests to fork. This
almost halves the runtime of the full test suite, from ~170 to ~90
seconds when running quietly.
The initial version of these changes explicitly marked all those classes
needing forking with @pytest.mark.forked. Drew Deverux however pointed
out a much smarter way to automatically do this for those cases where
the tango_context fixture is used, which is what's going in in this
final version of the changes. After this there were still a few tests
that needed manual marking.
Signed-off-by:
Rodrigo Tobar <rtobar@icrar.org>
Showing
- setup.cfg 1 addition, 2 deletionssetup.cfg
- tests/conftest.py 4 additions, 0 deletionstests/conftest.py
- tests/test_csp_master.py 1 addition, 0 deletionstests/test_csp_master.py
- tests/test_csp_obs_device.py 1 addition, 0 deletionstests/test_csp_obs_device.py
- tests/test_logger_device.py 1 addition, 0 deletionstests/test_logger_device.py
- tests/test_obs_device.py 1 addition, 0 deletionstests/test_obs_device.py
Please register or sign in to comment