Skip to content

fix(tests): repair the bwrap contract suite and gate it - #5110

Merged
dan-petty merged 3 commits into
mainfrom
fix/4715-bwrap-contract-suite
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/4715-bwrap-contract-suite

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

No automatic run selected the 55 tests with the bwrap mark, and in the devcontainer they gave 2 failed, 53 passed and 2 errors: two process-tree tests read /proc in the test process, which the host path guard refuses. These tests now read the process table with ps under @pytest.mark.live("ps"). The new bwrap row of devops ci runs pytest -m bwrap over the two sandbox contract suites, with a bound of 60 s for each test, after the host check of the sandbox executor. Static Analysis runs the row on its GitHub-hosted runner, which can make the sandbox with no install. On a host that cannot, the row starts no test, passes and shows the cause, also in a cached verdict.

Closes #4715

Change: openspec/changes/archive/2026-11-12-4715-bwrap-contract-suite/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/tests The test suite, its fixtures, fakes and floor labels Nov 12, 2026
The two process-tree tests of the bwrap contract suite read /proc in the
test process, which the host path guard refuses, so the suite gave
2 failed, 53 passed and 2 errors. They now read the process table with ps
under @pytest.mark.live("ps").

The new bwrap row of devops ci runs pytest -m bwrap over the two sandbox
contract suites after the host check of the sandbox executor. On a host
that cannot make the sandbox, the row starts no test, passes, and shows
the cause, also in a cached verdict.

Closes #4715
Static Analysis runs the bwrap row on its GitHub-hosted runner, where
bubblewrap can make the sandbox. The row gives each test a bound of 60 s,
which is shorter than the 3-minute limit of the gate step, so a hung test
fails with its own report. The documents and the change folder say that
the row runs on that runner.
@dan-petty
dan-petty force-pushed the fix/4715-bwrap-contract-suite branch from 2587b66 to b522368 Compare November 12, 2026 15:09
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence

Fail-to-pass (uv run devops ci fail-to-pass --base origin/main, head 141cbd2): 5 failed on base, all pass on head. The 5 tests are the new tests of tests/commands/test_ci_bwrap_row.py. The replay does not select the tests marked bwrap, so their result is below.

The bwrap suite (uv run pytest -m bwrap -n 0 tests/sandbox/test_host_sandbox.py tests/ai/test_tool_executor_contract.py, devcontainer):

Tree Result Time
origin/main 3109817 2 failed, 53 passed, 2 errors (host path reached without a fake: /proc/1/cmdline) 3.34 s
this branch 55 passed 3.58 s

The slowest test takes 2.02 s. The row gives each test a bound of 60 s.

The bwrap row: uv run devops ci --only bwrap --check --no-cache passes in 9.27 s in the devcontainer.

Static Analysis (Actions API, job and gate step times):

Run Job Gate step bwrap row Critical row
main 3109817, before 171 s 90 s none -
this PR, first push 142 s 82 s 49 s, pass security 81 s
this PR, second push 133 s 76 s 45 s, pass security 76 s

The job count and the runner count do not change: the row runs inside the existing Static Analysis job. The ubuntu-26.04 runner of that job can make the sandbox with no install, so the contract suite of the real sandbox now runs on each pull request. The bound of 60 s for each test is shorter than the 3-minute limit of the gate step, and test_a_hung_bwrap_test_fails_before_the_gate_step_of_static_analysis_stops holds that.

Other checks run here: tests/commands/, tests/ci/, tests/roadmap/test_roadmap_runner_tools.py (3,809 passed), the same set with a plugin that removes bubblewrap from the host (3,780 passed), and tests/ai/, tests/invariants/, tests/security/, tests/sandbox/, tests/telemetry/ (7,163 passed).

Owner steps: none. No workflow, repository setting or cluster object changes.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 15:23
@dan-petty
dan-petty merged commit 9a0659d into main Nov 12, 2026
36 checks passed
@dan-petty
dan-petty deleted the fix/4715-bwrap-contract-suite branch November 12, 2026 15:23
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings after merge:

  1. major, src/devops_cli/commands/ci.py: the host check of the bwrap row uses the code that the row must test. Confirmed. _sandbox_host_refusal() calls SandboxToolExecutor().host_refusal(), and its probe comes from HostSandbox.build_bwrap_args. With a bind of a missing source path added to build_bwrap_args, the check returned bubblewrap cannot make a sandbox on this host: bwrap: Can't find source path /no/such/source: No such file or directory. Without the change it returned None. Each refusal makes the row skip and pass, and a probe timeout does the same. This pull request is merged, so I filed fix(ci): the bwrap row passes when the sandbox command fails #5119 with the evidence and the proposed fix (a fixed probe command that does not come from build_bwrap_args, and a timeout as a failure). This pull request still improves the gate: before it, nothing ran the suite.

dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.119.0](v0.118.0...v0.119.0)
(2026-11-12)


### Features

* **repos:** the claim sets In Progress
([#5111](#5111))
([06ef1c6](06ef1c6))
* **roadmap:** a fix-plan step repairs a plan PR with open findings
([#5104](#5104))
([ca5b16d](ca5b16d))
* **roadmap:** extend stage review rounds while open findings drop
([#5090](#5090))
([bacf713](bacf713))
* **roadmap:** re-anchor a stale citation that matches one line
([#5040](#5040))
([16356d8](16356d8))


### Bug Fixes

* **ci:** keep failed test IDs in the service image shard summary
([#5106](#5106))
([88589ef](88589ef))
* **github:** count each page of a paginated GitHub read
([#5070](#5070))
([908e24a](908e24a))
* **github:** keep the metrics permissions out of the runner Job token
([#5064](#5064))
([fb549ff](fb549ff))
* **github:** pace mutations through the clock seam
([#5063](#5063))
([2bd87bc](2bd87bc))
* **k8s:** delete the CoreDNS files that k3s never applies
([#5055](#5055))
([463f601](463f601))
* **monitoring:** tidy LLM stack windows, units and lines
([#5052](#5052))
([375d724](375d724))
* **roadmap:** a refused kept plan uses no stage gate return
([#4983](#4983))
([b8adbca](b8adbca))
* **roadmap:** count a command as removed only when MUST NOT governs it
([#4985](#4985))
([2e6f407](2e6f407))
* **roadmap:** cut prose after a cited stage command
([#4982](#4982))
([a172563](a172563))
* **roadmap:** name every module of a group with no named test
([#5089](#5089))
([27a0e79](27a0e79))
* **roadmap:** stage returns every open review finding to the planner
([#5067](#5067))
([21b116e](21b116e))
* **roadmap:** the alternatives check reads the tools in use
([#5062](#5062))
([8903233](8903233))
* **roadmap:** the constants gate reads 6_500 and no new value
([#5080](#5080))
([8a7b113](8a7b113))
* **roadmap:** the constants gate reads only a stated value
([#5042](#5042))
([cf4733e](cf4733e))
* **telemetry:** read repository traffic as the GitHub App
([#4932](#4932))
([7c42823](7c42823))
* **tests:** close the UDP, DNS and git gaps of the network floor
([#5101](#5101))
([047ee48](047ee48))
* **tests:** repair the bwrap contract suite and gate it
([#5110](#5110))
([9a0659d](9a0659d)),
closes [#4715](#4715)


### Performance Improvements

* **ci:** build the Service image once for its test shards
([#5079](#5079))
([dcf5bd5](dcf5bd5))
* **ci:** run only the required checks on the release PR
([#5057](#5057))
([8174071](8174071))
* **ci:** stop the cache export of pull request image builds
([#5113](#5113))
([ba30820](ba30820))
* **roadmap:** consolidate keeps its vectors in the shared tiers
([#5099](#5099))
([2a8bf1a](2a8bf1a))


### Code Refactoring

* **roadmap:** one Status writer for every job
([#5109](#5109))
([24cfedc](24cfedc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/tests The test suite, its fixtures, fakes and floor type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tests): repair the bwrap contract suite and gate it

1 participant