Skip to content

ci: sync NTFC setup with nuttx (ntfc 0.0.3, fail-fast install, drop watchdog) - #3943

Merged
casaroli merged 3 commits into
apache:masterfrom
Brijesh-Thakkar:ci/ntfc-sync-with-nuttx
Nov 1, 2026
Merged

casaroli merged 3 commits into
apache:masterfrom
Brijesh-Thakkar:ci/ntfc-sync-with-nuttx

Conversation

@Brijesh-Thakkar

@Brijesh-Thakkar Brijesh-Thakkar commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Bring the NTFC part of .github/workflows/build.yml in line with apache/nuttx
(three commits):

  • Bump ntfc==0.0.1 to ntfc==0.0.3. apache/nuttx has used 0.0.3 since
    8f4a5b2bd3. This workflow already uses the same nuttx-ntfc-testing tag
    (release-0.0.2) and runs the citest/run.sh scripts of the nuttx tree it
    checks out, so the NTFC version should match.
  • Fail the job when pip install ntfc fails on the last attempt. The loop
    was pip install ... && break with nothing after it, so after three
    failed attempts the job carried on and failed later with a missing ntfc
    command. It now prints "Failed to install NTFC after 3 attempts" and
    exits 1, as in nuttx.
  • Remove the ( sleep 7200 ; echo Killing pytest after timeout... ; pkill -f pytest )& watchdog. NTFC runs pytest in-process, so no process
    has "pytest" in its command line and the pattern only matched the
    bash -c job script and the watchdog subshell (their script text contains
    the word); on a timeout it would have killed the whole step. It is
    redundant anyway: NTFC bounds each test session with timeout_session in
    the config.yaml of the nuttx tree (3600 s when not set, 6000 s for
    sim/citest).

Follows apache/nuttx#20958 (merged), which removed the same watchdog from
nuttx in favour of NTFC's session timeout (7fe6168725).

Part of apache/nuttx#17717

Impact

  • CI only; no source changes.
  • ntfc 0.0.1 -> 0.0.3 for the Linux build job. apache/nuttx CI already runs
    0.0.3 with the same test cases (release-0.0.2).
  • A failed NTFC installation now fails the job at the install step.
  • No test limits change: the per-session limits come from the nuttx tree and
    stay at 3600 s (NTFC default) / 6000 s (sim/citest). On a timeout NTFC
    stops the session, keeps its reports and exits with status 1, so the job
    still fails.
  • The old watchdog also (accidentally) bounded a hung build at 2 hours.
    Without it the Linux job falls back to GitHub's default of 360 minutes
    (same as in nuttx now). A step-level
    timeout-minutes could be a follow-up if wanted.

Differences with the nuttx workflow that I left as they are:

  • NUTTX_ROMFS_PASSWD_PASSWORD in the "Run builds" step: apps-only, added
    on purpose by 1d15c81 for sim/login.
  • The "Restore ccache" / "Prepare ccache for caching" and the
    "Run host_info sanity check" steps exist in nuttx and not here. Not NTFC
    related; I did not want to mix it in.
  • nuttx 1c596841ec ("ci/workflow: resolve network timeout and MTU issues in
    docker builds") added a ~/.curlrc with curl timeouts/retries to the "Run
    builds" step and --depth 1 to the nuttx-ntfc-testing clone. This is a
    separate network-robustness change, not part of the watchdog removal, so it
    is not included here.

The rest of the NTFC block (pip flags --default-timeout=100 --retries 10,
nuttx-ntfc-testing tag release-0.0.2, the clone retries with backoff,
NTFCDIR) is identical to the current apache/nuttx build.yml.

Testing

Validated locally for the nuttx PRs, with this repository as ../apps
(upstream/master): pip install ntfc==0.0.3 (CI flags) plus sim:citest
(cibuild.sh -c -A -N -R -S, gcc-12.5.0, nuttx-ntfc-testing release-0.0.2):
1221 passed / 0 failed / 306 skipped. A copy of the sim config.yaml with
timeout_session: 60 made NTFC stop by itself with
session-timeout: 60.0 sec exceeded, keep its results in result/ and exit
with status 1.

In this repository:

  • python -c "import yaml; yaml.safe_load(open('.github/workflows/build.yml'))"
    parses; the if/else around cibuild.sh is intact (the else branch now
    only runs cibuild.sh).
  • The retry block is byte-identical to the one in the current apache/nuttx
    .github/workflows/build.yml (checked after #20958).
  • ../nuttx/tools/checkpatch.sh -c -u -m -g upstream/master..HEAD (the
    command of check.yml) passes.

Caveat: the changed workflow itself was not run on GitHub Actions; the failure
path of the install loop (3 failed attempts) was not triggered.

Assisted-by: Claude Code:claude-sonnet-5-5 (analysis, local test runs and drafting). I reviewed every change and ran the tests myself.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@jerpelea jerpelea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please explain
Generated-by: Claude Code

@Brijesh-Thakkar

Copy link
Copy Markdown
Contributor Author

Thanks @jerpelea, I’d used the ASF Generated-by: tag instead of the Assisted-by: format from CONTRIBUTING.md 1.5. I’ve updated the commits to Assisted-by: Claude Code:claude-sonnet-5-5 above my Signed-off-by. The code is unchanged.

To explain: I used Claude Code to help analyse the code, run the local tests I reviewed every line of the change and ran the tests myself, and the Signed-off-by is mine

The Linux job installs ntfc==0.0.1, while apache/nuttx has used
ntfc==0.0.3 since 8f4a5b2bd3 (".github/workflows/build.yml: bump NTFC
to 0.0.3"). This workflow already uses the same nuttx-ntfc-testing tag
(release-0.0.2) as nuttx, and it runs the citest/run.sh scripts from the
nuttx tree it checks out, so the NTFC version should match too.

Part of apache/nuttx#17717

Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Brijesh Thakkar <[email protected]>
The retry loop around "pip install ntfc" uses "&& break" and nothing
after the loop checks the result, so when all three attempts fail the
job carries on without NTFC. The failure then only shows up later, as a
missing "ntfc" command in the citest run.sh script of the nuttx tree,
which is hard to trace back to the network problem.

Fail the job with a message after the last attempt, as apache/nuttx
does.

Part of apache/nuttx#17717

Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Brijesh Thakkar <[email protected]>
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 bounds each test session itself
with "timeout_session" in the config section of the citest config.yaml
files of the nuttx tree (3600 seconds when not set, 6000 seconds for
sim/citest), enforced through pytest-timeout --session-timeout. When the
limit is reached NTFC stops the session, keeps its reports and exits
with status 1, so the job still fails.

Note that the session timeout covers the test session only, not the
build. This matches the change made in apache/nuttx.

Part of apache/nuttx#17717

Assisted-by: Claude Code:claude-sonnet-5-5
Signed-off-by: Brijesh Thakkar <[email protected]>
@Brijesh-Thakkar
Brijesh-Thakkar force-pushed the ci/ntfc-sync-with-nuttx branch from 3c58820 to fe9fe46 Compare October 31, 2026 06:20
@Brijesh-Thakkar

Copy link
Copy Markdown
Contributor Author

The Linux jobs failed at the “Docker Pull” step (ghcr blob digest mismatch) before any build or NTFC step ran, so it looks like a registry hiccup. I’ve rebased onto current master to re-run CI.

@casaroli
casaroli merged commit 5cf28b6 into apache:master Nov 1, 2026
41 checks passed
@Brijesh-Thakkar
Brijesh-Thakkar deleted the ci/ntfc-sync-with-nuttx branch November 2, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants