Skip to content

test(isolate): AWS integration-harness coverage + create-latency benchmark#341

Merged
sumansaurabh merged 2 commits into
mainfrom
feat/isolate-integration-harness
Jul 18, 2026
Merged

test(isolate): AWS integration-harness coverage + create-latency benchmark#341
sumansaurabh merged 2 commits into
mainfrom
feat/isolate-integration-harness

Conversation

@sumansaurabh

Copy link
Copy Markdown
Contributor

Summary

  • Adds the first AWS integration-harness coverage for the V8-isolate (workerd) runtime: a single-node-isolate scenario, CapIsolate + UC-103/104/105, make integration-single-isolate, and a UC-94 isolate create-latency benchmark (make integration-benchmark-isolate). Before this, isolate — and the per-sandbox egress attribution shipped in v0.7.16 / feat(isolate): per-sandbox egress attribution via per-slot service pool #340 — was only ever validated by an ad-hoc manual recipe, so it left no reports/*.md and had no make target.
  • Test-harness only — no runtime, server, pkg/, or SDK code changes. The isolate provisioning layer already existed (install.sh --with-isolate downloads a SHA-pinned workerd + writes SB_ENABLE_ISOLATE=true; Terraform default_with_isolate; bootstrap.sh.tftpl emits the flag), so this is purely the harness layer, mirroring how gvisor is wired (advertisement-only capability, provisioning-driven, no config-overlay flip and no node-side staging — the UCs upload JS bundles over POST /v1/js-bundles at runtime).
  • Live-validated end to end on real AWS with the released v0.7.16 binary + workerd (no scp/cross-compile — a vanilla provision is production-faithful).

Code-path diagram

flowchart TB
  subgraph provision["make integration-single-isolate → run.sh single-node-isolate"]
    TF["Terraform apply<br/>default_with_isolate = true"] --> INS["install.sh --with-isolate<br/>SHA-pinned workerd → /usr/local/bin/workerd<br/>+ SB_ENABLE_ISOLATE=true"]
    INS --> EUD["extra_user_data (NEW)<br/>SB_ISOLATE_USE_JAIL=false + restart sandboxd"]
    EUD --> HEALTH["wait DNS/TLS/health → isolate:ok<br/>supported_runtimes=[docker,isolate]"]
  end
  subgraph suite["integration suite — CapIsolate gates (NEW)"]
    HEALTH --> U103["UC-103 upload bundle → create isolate → exec-fetch"]
    HEALTH --> U105["UC-105 js-bundle catalogue CRUD"]
    HEALTH --> U104["UC-104 two sandboxes / one tenant:<br/>allow-list vs block-all egress differ"]
    HEALTH --> U94["UC-94 (bench, AEROL_BENCH=1 only)<br/>warm create latency, 10 samples"]
  end
  U103 --> RPT["report matrix + auto-teardown"]
  U104 --> RPT
  U105 --> RPT
  U94 --> RPT
Loading

Before → after: before this PR there was no isolate scenario/UC/target and no isolate row in any report; after, single-node-isolate provisions the runtime through the existing --with-isolate path and the suite exercises create/exec, per-sandbox egress, the bundle catalogue, and create latency.

Sandbox boot impact

N/A — test harness only; no work added to CreateSandbox or any callee. The one node-side change the scenario makes is appending SB_ISOLATE_USE_JAIL=false to sandboxd.env via extra_user_data (a provisioning-time env write + restart, the same hook the wasm/gvisor scenarios use), not a code path in the boot sequence.

Idempotency

N/A — no API surface changed. The UCs are clients of existing endpoints: js-bundle upload is content-addressed and idempotent (re-upload of the same name+source resolves to the same digest), and sandbox create/destroy are unchanged. The bench reuses one uploaded bundle + one shared tenant across all samples precisely because upload is idempotent.

Failure-path consistency

N/A — no multi-step caddy+store write path changed. Isolate is HTTP-only / host-mediated and the change is test-only. The harness's own hygiene is unchanged: every created sandbox registers a t.Cleanup destroy, and run.sh (no --keep) tears the deployment down on EXIT/INT/TERM and collects reports/<scenario>-failure-logs.txt before teardown on any failure.

L4 / host-port-pool changes

N/A — neither touched. Isolate never calls TryReserveHostPort / allocateHostPort / EnsureLayer4 / the l4Ready latch; the harness adds no L4 code.

Test plan

  • Offline: go vet -tags=integration ./integration-tests/suite/... (exit 0); go test ./integration-tests/suite/harness/... (green — includes the known-capability check extended with CapIsolate); go test ./integration-tests/report/... (green — registry-driven, classifies the new UCs); make fmt clean.
  • Live functional (make integration-single-isolate, fresh t3.medium, released v0.7.16 + workerd): pass 57 · fail 0 · skip 51 · inconclusive 0. UC-103/104/105 all green. UC-104 proved per-sandbox egress attribution on real infra — an allow-listed sandbox reached example.com (200) but 403'd a non-allowed host, while a block-all sandbox in the same tenant group 403'd everything. Torn down clean (34 resources destroyed, no leak).
  • Live benchmark (make integration-benchmark-isolate, 10 samples): warm isolate create server p50 = 4 ms / p90 = 6 ms / p99 = 19 ms, 0 failures (stages: create 6 ms mean, cluster_promote 4 ms, create_with_id 1 ms, cluster_seal 0 ms). The ~262 ms api↔server gap is laptop→us-east-1 WAN, not create cost. Torn down clean (34 resources destroyed, no leak).

Deliberate scope note

The scenario runs the isolate jail off (SB_ISOLATE_USE_JAIL=false). The jail defaults on, but its chroot is not yet populated with the workerd binary (chroot-populate is the tracked "full jail realization" follow-up in plans/isolate-runtime.md); with the jail on, workerd is exec'd inside an empty chroot and every create fails no such file or directory even though the binary is installed and health reports isolate:ok. Jail-off is how the runtime is currently deployable end to end, and is orthogonal to the egress attribution UC-104 proves. Follow-ups: a jail-ON isolate scenario once chroot-populate lands.

🤖 Generated with Claude Code

sumansaurabh and others added 2 commits July 18, 2026 13:50
The V8-isolate (workerd) runtime had zero coverage in the AWS integration
harness — no scenario, no Makefile target, no reports/*.md — so it (and the
per-sandbox egress attribution shipped in v0.7.16 / PR #340) was only ever
validated by an ad-hoc manual recipe. This makes it repeatable.

The provisioning layer already existed (install.sh --with-isolate downloads a
SHA-pinned workerd + writes SB_ENABLE_ISOLATE=true; Terraform default_with_isolate;
bootstrap.sh.tftpl emits the flag), so this is purely the harness layer, mirroring
how gvisor is wired (advertisement-only capability, provisioning-driven, no
config-overlay flip and no node-side staging — the UCs upload JS bundles over
POST /v1/js-bundles at runtime).

- scenarios/single-node-isolate.{tfvars,caps.yml}: one mixed t3.medium node with
  default_with_isolate=true; caps [docker, isolate, domain]. A mixed node is a
  worker, so supportedRuntimesForConfig advertises "isolate" and admission
  accepts isolate creates.
- CapIsolate + UC-103 (runs), UC-104 (per-sandbox egress allowlist), UC-105
  (js-bundle catalogue CRUD) in the registry; suite/isolate_test.go implements
  them via the SDK + a small harness Delete helper, driving the fetch handler
  through toolbox exec (exec command -> fetch URL path).
- Makefile integration-single-isolate + run.sh 'all' list / usage header.

The scenario disables the isolate jail (SB_ISOLATE_USE_JAIL=false via
extra_user_data): the jail defaults on, but its chroot is not yet populated with
the workerd binary (chroot-populate is the tracked "full jail realization"
follow-up), so with the jail on workerd is exec'd inside an empty chroot and
every create fails "no such file or directory" even though it is installed on the
host and health reports isolate:ok. Jail-off is how the runtime is currently
deployable end to end and is orthogonal to the egress attribution UC-104 proves;
a jail-ON scenario is a follow-up gated on chroot-populate.

Live-validated on a fresh single-node-isolate deployment (released v0.7.16 +
workerd, no binary hacks): pass 57 / fail 0 / skip 51, all three isolate UCs
green — including UC-104 proving an allow-listed sandbox reaches example.com but
403s a non-allowed host while a block-all sandbox in the SAME tenant group 403s
everything. Torn down clean (34 resources destroyed, no leak).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire the V8-isolate runtime into the UC-94 create-latency sweep and add
make integration-benchmark-isolate[-only], so isolate gets a proper p50/p90/p99
artifact like the docker/gvisor/wasm/fc rows.

- benchmark_test.go: add {"isolate", CapIsolate} to benchRuntimes; benchRuntimeSpec
  gains bundleRef + tenantID; selectedBenchRuntimes uploads the bench bundle once
  (content-addressed, idempotent) and pins a shared tenant so every sample lands
  in ONE warm workerd group (steady-state create, not a per-sample group spawn);
  benchCreateOptions sets ModuleRef/TenantID for the isolate case.
- single-node-isolate.caps.yml: advertise `benchmark`. UC-94 stays dormant unless
  AEROL_BENCH=1, so the functional `make integration-single-isolate` still skips
  it; UC-95 (density) stays skipped — it also needs CapCluster.
- Makefile: integration-benchmark-isolate[-only] mirroring the wasm/gvisor bench
  targets (AEROL_BENCH_RUNTIMES=isolate + --bench-only), reusing the jail-off
  single-node-isolate scenario.

Live result (single-node-isolate t3.medium, released v0.7.16 + workerd, jail off,
10 samples, 0 failures): warm isolate create SERVER p50=4ms p90=6ms p99=19ms
(stages: create 6ms mean, cluster_promote 4ms, create_with_id 1ms, cluster_seal
0ms); api p50=266ms (the ~262ms api-server gap is laptop->us-east-1 WAN, not
create cost). Torn down clean (34 resources destroyed, no leak).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
microvm c0aafa2 Commit Preview URL

Branch Preview URL
Jul 18 2026, 08:55 AM

@sumansaurabh
sumansaurabh merged commit 75bc3ed into main Jul 18, 2026
11 of 12 checks passed
@sumansaurabh
sumansaurabh deleted the feat/isolate-integration-harness branch July 18, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant