Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
Every test must finish within the watchdog timeout, which is set to 5 minutes, or the value of the env var QTEST_FUNCTION_TIMEOUT in milliseconds, as seen in qtestcase.cpp:
static std::chrono::milliseconds defaultTimeout() { if (timeout == -1) { bool ok = false; timeout = qEnvironmentVariableIntValue("QTEST_FUNCTION_TIMEOUT", &ok); if (!ok || timeout <= 0) timeout = 5*60*1000; } return std::chrono::milliseconds{timeout}; }
There are valid reasons to decide the timeout in runtime, for example if we know that under certain conditions the specific test runs too slow. This could be done by calling a static timer in initMain() or initTestCase() before any testcases have been executed.
Attachments
Issue Links
- relates to
-
QTBUG-81979 Allow configuring a global QTestLib timeout
- Reported
-
QTBUG-110314 Add QTestRandomNumber that tracks the seed used for reproducability
- Open