Brijesh-Thakkar opened a new pull request, #20958:
URL: https://github.com/apache/nuttx/pull/20958

   ## Summary
   
   Remove the external `pkill -f pytest` watchdog from 
`.github/workflows/build.yml`
   in 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 -c` job
       script 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_session` from the `config:` section of
       `config.yaml` (3600 s when not set, 6000 s for `sim/citest`) through
       pytest-timeout's `--session-timeout` (`ntfc/pytest/mypytest.py:350-352`).
     * `Documentation/testing/ntfc.rst`: it installed `ntfc==0.0.1`, although CI
       uses 0.0.3 (8f4a5b2bd3).
     * `Documentation/platforms/risc-v/qemu-rv/boards/rv-virt/index.rst`: it 
told
       the reader to run `configs/citest/run`, which was renamed `run.sh` in
       b88f86ba5d 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
   
     * No test limits change. The per-session limits stay as they are: 3600 s
       (NTFC default) for the citest configurations that do not set
       `timeout_session`, 6000 s for `sim/citest`.
     * Unlike the old `pkill`, a timeout now keeps the NTFC reports: NTFC stops
       the session, writes `result/<timestamp>/` and exits with status 1, so the
       job still fails and `run.sh` still saves the results as artifacts.
     * The session limit is checked after each test (pytest-timeout,
       `pytest_timeout.py:195-199`), so a single hung test is bounded by the
       per-test timeout (800 s default in NTFC) and the session can end up to
       that much past the limit.
     * Open question for maintainers: the old watchdog also (accidentally)
       bounded a hung *build* at 2 hours, since it was started before
       `cibuild.sh` and measured the whole step. Without it the Linux job falls
       back to GitHub's default of 360 minutes (only the `msys2` job has a
       `timeout-minutes`). A step-level `timeout-minutes` could be a follow-up 
if
       wanted.
   
   ## 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:citest` built with the same commands
   as CI (`cibuild.sh -c -A -N -R -S`).
   
   Timeout check: a copy of `sim/citest/config.yaml` with `timeout_session: 60`
   and the built `nuttx` ELF, run with the same arguments as `citest/run.sh`
   (`ntfc test --testpath=... --confpath=... --jsonconf=...`):
   
   ```
   !!!!!!!!!!!!!!!!!!!!!! session-timeout: 60.0 sec exceeded 
!!!!!!!!!!!!!!!!!!!!!!
   ======================== 1 passed in 254.65s (0:04:14) 
=========================
   [RESULT_SUMMARY] total:1 passes:1 failures:0 skipped:0 errors:0 time:254.25 
modules:1
   ntfc exit code=1  elapsed=269s
   ```
   
   NTFC stopped on its own after the first test (`test_os[main]`, ~254 s, hence
   the overshoot of the 60 s limit); the other 1526 tests were not run; the
   `result/<timestamp>/` directory (xml, html report, `pytest.debug.log`) was
   written; 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..HEAD` passes;
   `build.yml` still parses as YAML and its `if`/`else` is intact (the `else`
   branch now only runs `cibuild.sh`).
   
   Caveat: only `sim:citest` was 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.yml` has the same watchdog and still installs
   `ntfc==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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to