GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
testsuite

Testsuite pytest stability improvements

Increases pytest timeouts and improves cache handling for more reliable test execution.

The testsuite’s Python-based tests using pytest were prone to instability due to default timeouts that were too short for imports and file system scanning, especially on slower network mounts. This change increases the timeout and ensures failures are reported on timeout. Additionally, it prevents pytest from using a shared cache directory outside the build directory when source and build trees share a common parent, improving parallel test run reliability.

In Details

Testsuite invocation of pytest via lib/gcov.exp and lib/scanhtml.exp (among others) used a default expect timeout that was insufficient for module import and filesystem scanning on slower I/O. This commit introduces pytest_invoke in lib/target-supports.exp to manage pytest invocations, increasing the default timeout to 300 seconds and enabling explicit failure reporting on timeout. It also addresses an issue where pytest would incorrectly set its root directory to a common parent of the build and source directories, potentially causing parallel test issues due to cache collisions; t…

For Context
pytest
A popular Python testing framework that provides a rich set of features for writing and running tests, including fixtures, parametrization, and test discovery.
expect
A tool and scripting language used for automating interactions with programs that expose a text-based interface, often used in test harnesses.
NFS mount
Network File System mount. A way to access files stored on a remote server as if they were on a local disk, which can sometimes have higher latency than local storage.
Filed Under: testsuitepytestreliability