[GRASS-git] [OSGeo/grass] 89fe85: grass.gunittest: Set max time (timeout) per test (...
Vaclav Petras
noreply at github.com
Mon Feb 7 09:04:29 PST 2022
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 89fe85cbad9f77d23e1e8c4a1b1efc1b897f2cf9
https://github.com/OSGeo/grass/commit/89fe85cbad9f77d23e1e8c4a1b1efc1b897f2cf9
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2022-02-07 (Mon, 07 Feb 2022)
Changed paths:
M .gunittest.cfg
M python/grass/gunittest/invoker.py
M python/grass/gunittest/main.py
M python/grass/gunittest/reporters.py
Log Message:
-----------
grass.gunittest: Set max time (timeout) per test (#2172)
This sets max execution time (timeout) per test file. After that, the test is ended. The subprocess timeout mechanism is used for that. Sub-processes of the test process may (likely will) keep running, but the testing continues.
Test which times out is counted as a failure. Additional value is passed around in the code to indicate timeout, but it is not treated as a separate type of result. However, it is clearly visible in the outputs.
The terminology (such as timeout versus max seconds per test) and the interface (config and messages) is similar to pytest.
The value for timeout comes from the test for t.rast.algebra which takes 3.5 mins.
This also changes the subprocess code to use higher-level subprocess.run instead of subprocess.Popen. It still uses subprocess.PIPE instead of capture_output for Python 3.6 compatibility (we still have Ubuntu 18.04 CI now on main).
More information about the grass-commit
mailing list