Skip to content

e2e: test WorkerPool configRef changes and bad SandboxConfig asset SHA256 - #3566

Open
Shrutiya Mohan (shrutiyam-glitch) wants to merge 6 commits into
agent-substrate:mainfrom
shrutiyam-glitch:e2e-configref-and-assets
Open

Shrutiya Mohan (shrutiyam-glitch) wants to merge 6 commits into
agent-substrate:mainfrom
shrutiyam-glitch:e2e-configref-and-assets

Conversation

@shrutiyam-glitch

@shrutiyam-glitch Shrutiya Mohan (shrutiyam-glitch) commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3008.

Adds two end-to-end tests in internal/e2e/suites/demo:

TestWorkerPoolSwitchSandboxConfig (sandboxconfig_test.go)

Covers atecontroller handling of a WorkerPool's configRef, multi-pool scheduler placement across two WorkerPools matching the same ActorTemplate selector, and switching configRef while an actor is running:

Step Action Expected
1 Boot actor on poolA (configA at v1, memory=2, file=2, rootfs=2), suspend with a v1-stamped MEMORY snapshot, and start poolB (configB at v2) with the same selector labels poolB starts warming up in parallel
2 Delete configA while poolA uses it, then point poolA's configRef at a missing SandboxConfig and a wrong-class SandboxConfig configA stays Terminating under ate.dev/workerpool-protection; poolA reports Resolved=False (SandboxConfigDeleting, SandboxConfigNotFound, SandboxClassMismatch) while keeping configA in status.sandboxClasses[0].configRef and its worker on v1
3 With both poolA (v1) and poolB (v2) ACTIVE and free, resume the actor, then switch poolA's configRef to configB while the actor runs Scheduler selects poolA's worker (MEMORY restore: 3, 3, 3); switching poolA to configB releases and deletes configA, re-registers poolA's worker on v2, and leaves the running actor on v1 (4, 4, 4)
4 Suspend the actor and resume again Snapshot is stamped with v1 from WorkerAssignment.sandbox_runtime (not the worker's new v2 default), and the next resume drops to ROOTFS on v2 (memory=1, file=5, rootfs=5)

TestBadVersionSHA (sandboxassets_test.go)

Covers atelet handling of a SandboxConfig version whose asset SHA256 fails verification:

Step Action Expected
1 Boot actor on v1 (memory=2, file=2, rootfs=2) and suspend with a v1-stamped MEMORY snapshot Snapshot is stamped with v1
2 Add v2 with a wrong SHA256 while defaultVersion stays v1 atelet records a Warning SandboxRuntimeSyncFailed Event (incomplete sandbox runtimes) on the worker pod and omits v2 from restorable_runtimes
3 Move defaultVersion to the broken v2 and resume the actor atelet records SandboxRuntimeSyncFailed for v2, keeps the worker registered on v1, and the actor restores MEMORY on v1 (3, 3, 3)
4 Fix v2's SHA256 Worker converges to v2 as default_runtime with v1 in restorable_runtimes

AI-assisted, I reviewed and tested it.

  • Tests pass
  • Docs updated

@shrutiyam-glitch
Shrutiya Mohan (shrutiyam-glitch) marked this pull request as ready for review November 2, 2026 20:01
Deleting the SandboxConfig a pool uses leaves it Terminating under the
workerpool-protection finalizer, and a configRef to a missing config or
one of the other class is refused; through all three the pool keeps its
config and the worker its runtime. A switch to another config of the same
class releases and deletes the old one and re-registers the worker while
an actor keeps running on the old runtime. That actor's next snapshot is
stamped from its assignment, not the worker's new default, and its next
resume drops to ROOTFS on the new default.

A second pool on the new config is up before the switch. With both pools
free, the resume lands on the old pool's worker, the only one advertising
the snapshot's runtime.

Signed-off-by: Shrutiya <shrutiyam@google.com>
atelet records a SandboxRuntimeSyncFailed Event on the worker pod and
leaves the version out: a broken restorable version is omitted, and a
broken default leaves the worker on what it last registered, so a
suspended actor still restores MEMORY. Once the SHA256 is fixed the worker
converges to the new default with the old version restorable.

Signed-off-by: Shrutiya <shrutiyam@google.com>
The scheduler drops its runtime requirement only when no worker meets it.
poolB cannot restore v1, so it is never a candidate for the first pass.

Signed-off-by: Shrutiya <shrutiyam@google.com>
Signed-off-by: Shrutiya <shrutiyam@google.com>
Check that configA is still Terminating right before the switch to
configB: the refused changes move spec off it, so only the switch may
release it. Have waitForPoolCondition require the Resolved condition at
the pool's current generation with no pendingConfigRef, so a stale
status or a leaked claim cannot satisfy it.

poolB runs on poolA's node, so the node pin from the suspend cannot
exclude it and both workers report the same host CPU. The wait for
poolA's re-registration compares against poolB's runtime.

Signed-off-by: Shrutiya <shrutiyam@google.com>
atelet stops at the first asset that fails to stage, and with every
SHA256 wrong it re-downloads whichever asset it visits first on each
retry, the kata image on microVM. The assets shared with v1 now stay
cache hits.

Signed-off-by: Shrutiya <shrutiyam@google.com>

This branch has not been deployed

No deployments
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.

2 participants