Repository navigation
ci: remove pytest watchdog in favour of NTFC session timeout - #20958
Merged
xiaoxiang781216 merged 2 commits intoOct 26, 2026
Merged
Conversation
The Linux build job starts "( sleep 7200 ; ... ; pkill -f pytest )&" in the background before running cibuild.sh. It was meant to stop a hung test run, but it does not do that now that the runtime tests use NTFC: NTFC runs pytest in-process, so no process has "pytest" in its command line. The pattern only matches the "bash -c" job script and the watchdog subshell, because their script text contains the word "pytest". When it fires it kills the whole step instead of the tests. The watchdog is also redundant. NTFC enforces a session timeout itself: "timeout_session" in the config section of config.yaml (3600 seconds when not set, 6000 seconds for sim/citest), passed to pytest-timeout as --session-timeout (ntfc/pytest/mypytest.py:350-352). When the limit is reached NTFC stops the session, keeps its reports and exits with status 1, so the job still fails. A local sim:citest run with "timeout_session: 60" confirmed this. Note that the session timeout covers the test session only, not the build. Part of apache#17717 Generated-by: Claude Code Signed-off-by: Brijesh Thakkar <[email protected]>
Documentation/testing/ntfc.rst says it installs the NTFC version currently used by NuttX CI, but it installs 0.0.1 while CI uses 0.0.3 since 8f4a5b2 ("bump NTFC to 0.0.3"). Update the version. The rv-virt page tells the reader to run configs/citest/run to run the CI scripts. That file no longer exists: it was renamed to run.sh in b88f86b and needs the environment set up by testbuild.sh. Point to the NTFC page, which describes how to run the CI tests locally, instead. Part of apache#17717 Generated-by: Claude Code Signed-off-by: Brijesh Thakkar <[email protected]>
Brijesh-Thakkar
requested review from
lupyuen,
raiden00pl,
simbit18,
tmedicci and
yf13
as code owners
October 24, 2026 09:42
xiaoxiang781216
approved these changes
Oct 24, 2026
|
Contributor
|
let's ignore ci error which is fixed by #20949 instead wasting ci resource by retrigger. |
GUIDINGLI
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the external
pkill -f pytestwatchdog from.github/workflows/build.ymlin favour of NTFC's built-in session timeout, as suggested by @raiden00pl in
#17717, and fix two stale documentation lines.
.github/workflows/build.yml: remove( sleep 7200 ; echo Killing pytest after timeout... ; pkill -f pytest )&.It never stopped the tests: NTFC runs pytest in-process, so no process has
"pytest" in its command line. The pattern only matched the
bash -cjobscript and the watchdog subshell (their script text contains the word), so
on a timeout it would have killed the whole step. It is also redundant:
NTFC enforces
timeout_sessionfrom theconfig:section ofconfig.yaml(3600 s when not set, 6000 s forsim/citest) throughpytest-timeout's
--session-timeout(ntfc/pytest/mypytest.py:350-352).Documentation/testing/ntfc.rst: it installedntfc==0.0.1, although CIuses 0.0.3 (8f4a5b2).
Documentation/platforms/risc-v/qemu-rv/boards/rv-virt/index.rst: it toldthe reader to run
configs/citest/run, which was renamedrun.shinb88f86b and cannot be run on its own (it needs the environment set by
testbuild.sh). It now links to the NTFC page.Part of #17717
Impact
(NTFC default) for the citest configurations that do not set
timeout_session, 6000 s forsim/citest.pkill, a timeout now keeps the NTFC reports: NTFC stopsthe session, writes
result/<timestamp>/and exits with status 1, so thejob still fails and
run.shstill saves the results as artifacts.pytest_timeout.py:195-199), so a single hung test is bounded by theper-test timeout (800 s default in NTFC) and the session can end up to
that much past the limit.
bounded a hung build at 2 hours, since it was started before
cibuild.shand measured the whole step. Without it the Linux job fallsback to GitHub's default of 360 minutes (only the
msys2job has atimeout-minutes). A step-leveltimeout-minutescould be a follow-up ifwanted.
Testing
Host: Ubuntu, Python 3.14.4 (CI uses 3.10), gcc-12.5.0, ntfc 0.0.3,
nuttx-ntfc-testing
release-0.0.2,sim:citestbuilt with the same commandsas CI (
cibuild.sh -c -A -N -R -S).Timeout check: a copy of
sim/citest/config.yamlwithtimeout_session: 60and the built
nuttxELF, run with the same arguments ascitest/run.sh(
ntfc test --testpath=... --confpath=... --jsonconf=...):NTFC stopped on its own after the first test (
test_os[main], ~254 s, hencethe overshoot of the 60 s limit); the other 1526 tests were not run; the
result/<timestamp>/directory (xml, html report,pytest.debug.log) waswritten; and the exit status was 1 although the test that ran passed.
For comparison, the same ELF and config with the unchanged
timeout_session: 6000: 1221 passed / 0 failed / 306 skipped in ~1090 s(limit not reached).
Other checks:
./tools/checkpatch.sh -g upstream/master..HEADpasses;build.ymlstill parses as YAML and itsif/elseis intact (theelsebranch now only runs
cibuild.sh).Caveat: only
sim:citestwas run. The QEMU targets (arm64, x86_64,rv-virt, sabre-6quad) and the change in the real GitHub Actions workflow are
left to CI.
Note
nuttx-apps
build.ymlhas the same watchdog and still installsntfc==0.0.1. I will follow up there with the same removal, bump it to 0.0.3(as nuttx CI already uses) and make the job fail fast if all install retries
fail, as the nuttx workflow does.
Part of #17717
Generated-by: Claude Code (analysis, test runs and drafting); reviewed and tested by me.