Skip to content

fix(ci): run GNU timeout in the experimental tests step on any image (#2020) - #2022

Merged
JarryShaw merged 3 commits into
mainfrom
fix/2020-gnu-timeout
Oct 21, 2026
Merged

JarryShaw merged 3 commits into
mainfrom
fix/2020-gnu-timeout

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

  • fix — corrects a defect

Description of your pull request and other information

Closes #2020. On Ubuntu 26.04 timeout is uutils 0.10.0, whose --kill-after SIGKILLs at once and only its child. Run unit tests (experimental.yml) now runs gnutimeout (GNU 9.7) where it exists, timeout otherwise.

…ofile (#2019)

Ubuntu 25.04+ confine /usr/bin/tshark with an enforcing AppArmor profile
that reads only under /tmp and /usr/share/wireshark, so PyShark tests on
ubuntu-26.04 runners fail with TSharkCrashException retcode 3.

- engine-tests (PyShark) and pypcap-parity (and its KTLO twin) gain a
  step after the tshark install that, when /etc/apparmor.d/tshark exists,
  appends 'file r ${GITHUB_WORKSPACE}/**,' to local/tshark and reloads
  the profile with apparmor_parser -r; a no-op on 24.04.
- tests/project/test_tshark_apparmor_2019.py pins the step's placement
  and runs its script against a scratch /etc/apparmor.d.
- Docs: note the AppArmor denial and the fix under PyShark's
  requirements; shift the unit-tests.yml line citations the new steps
  moved.

Closes #2019
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 21, 2026
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 21, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 85ba99c20.

A Sonnet cross-review confirmed:

  • Coverage: no other timeout with options exists in .github/ or util/, and the new test scans every workflow run: script.
  • Fallback: under bash -euo pipefail, command -v gnutimeout || command -v timeout resolves to /usr/bin/timeout on 24.04 and to /usr/bin/gnutimeout on 26.04, and exits 0 on both.
  • Behaviour (in ubuntu:26.04): uutils gives 137 after 1 s, and gnutimeout gives 124. A plain sudo timeout 60 apt-get behaves the same under both.
  • Tests: with main's step, the new test fails 4. On the head, the four modules give 87 passed. fix(ci): let tshark read the checkout past Ubuntu 26.04's AppArmor profile (#2019) #2021 adds no timeout.

One residual risk: the runner-images 26.04 readme does not list gnutimeout. If the runner image lacks it, the step falls back to uutils and the 137 failure returns. This PR's own Project tests job, once it lands on 26.04, will show which.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 21, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verified on a real Ubuntu 26.04 runner: this head's Project tests job ran on ubuntu-26.04 and passed, so gnutimeout is on the runner image and the three timeout tests pass there. That closes the residual risk.

The two red checks, Engines (PyShark) and parity 3.11, are #2019's AppArmor denial; their logs show "permission to read the file" on 26.04. That one is fixed by #2021. Each PR fixes the other's red check, so merging both turns main green on 26.04.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Coverage: 91.55% (unit tier, Python 3.15, 061752cf1, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19597 881 2618 867 92.11%
pcapkit/corekit 2567 71 816 37 96.57%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2930 23 1022 25 98.79%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17436 219 4582 185 98.15%
pcapkit/toolkit 872 36 298 10 95.21%
pcapkit/utilities 523 2 158 4 99.12%
pcapkit/vendor 4431 1995 1018 167 51.73%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

On PRs the "Plain unittest ordering" job is skipped, since it runs only on main. So I ran its project leg myself, the same way CI does (python util/run_unittest_leg.py project), on main d419d8c39 with #2021 and #2022 both merged in. Result: Ran 1675 tests ... OK (skipped=71). Both PRs' new modules ran and passed: test_tshark_apparmor_2019 and test_gnu_timeout_2020.

This host has GNU timeout. The uutils behaviour on 26.04 is covered instead by #2022's own Project tests job, which passed on a real ubuntu-26.04 runner.

…2020)

Ubuntu 26.04 ships uutils coreutils 0.10.0 as `timeout`, whose
`--kill-after` sends SIGKILL with the first signal and only to its
child: `Run unit tests` lost pytest's teardown grace and exited 137
where GNU's exits 124. The step now resolves `gnutimeout` (GNU 9.7 on
that image) where it exists, `timeout` otherwise.

- tests/project/test_gnu_timeout_2020.py: no workflow `run:` script
  gives a bare `timeout` an option; the step resolves before it runs,
  and its replay runs `gnutimeout` where one is on PATH
- adjust the step-text pins in the #1740, #1938 and #1963 tests
- docs: workflows.rst says which timeout runs
@JarryShaw

Copy link
Copy Markdown
Owner Author

This PR is now stacked on #2021, at head 72f84e5de = #2021's ebe8a06cd + this fix. On their own, each PR fails on the other's Ubuntu 26.04 bug: #2021 on the uutils timeout tests, and this one on the tshark AppArmor denial. With both in one tree, CI here can go fully green on a 26.04 runner. Merge #2021 first; this PR's diff then reduces to its own commit. On the stacked tree, the timeout/AppArmor pins plus test_unit_tests_queue give 135 passed. The review label is back to review: pending until CI and a re-review land on the new head.

@JarryShaw
JarryShaw force-pushed the fix/2020-gnu-timeout branch from 85ba99c to 72f84e5 Compare October 21, 2026 21:28
@JarryShaw JarryShaw added review: pending No verdict for the current head - never reviewed, or the head moved since the last one and removed review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 21, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at 72f84e5de. The verdict carries over from the two reviewed heads:

The stacked tree passes the shared pins (135 passed). CI on this head is the check of both fixes together.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: pending No verdict for the current head - never reviewed, or the head moved since the last one labels Oct 21, 2026
@JarryShaw
JarryShaw merged commit 185b317 into main Oct 21, 2026
55 checks passed
@JarryShaw
JarryShaw deleted the fix/2020-gnu-timeout branch October 21, 2026 21:59
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 21, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

CI: uutils timeout on Ubuntu 26.04 runners breaks --kill-after grace (main red)

1 participant