@@ -144,6 +144,30 @@ jobs:
144144 with :
145145 node-version : 22
146146
147+ # Same step as the `test` job above (it moved there with the 3-way unit
148+ # shard, #1288), repeated because jobs share no filesystem. WITHOUT IT this
149+ # leg is a runner lottery: `prepareDirectSandbox()`
150+ # returns null when bwrap is missing, so `overlayTargets()` in
151+ # test/sandbox-shim-compiled-form.test.ts yields [] and 4 cases fail on an
152+ # image that happens not to ship bubblewrap — MEASURED on two runs of the
153+ # same commit range, one printing `bwrap missing` 5 times and failing, the
154+ # other printing it 0 times and passing. The failures look like a code
155+ # regression and are not one, which is the expensive part.
156+ #
157+ # ⚠️ Unlike vitest, `bun test` has no host-level skip gate here: the suite
158+ # under `describe.skipIf(process.platform !== 'linux')` DOES run on this
159+ # linux runner and can only fail once bwrap is absent. Keep this step in
160+ # sync with the `test` job's copy.
161+ - name : Enable bwrap sandbox for integration tests (best-effort)
162+ run : |
163+ sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
164+ command -v bwrap >/dev/null || sudo apt-get install -y bubblewrap || true
165+ if bwrap --bind / / --unshare-user -- /bin/true 2>/dev/null; then
166+ echo "bwrap userns OK — sandbox integration tests will run for real"
167+ else
168+ echo "bwrap still unavailable — sandbox integration tests will skip (see test-side gate)"
169+ fi
170+
147171 - uses : oven-sh/setup-bun@v2
148172 with :
149173 bun-version : 1.4.1
0 commit comments