Skip to content

Commit 24482d5

Browse files
e2e: resume fidelity after SandboxConfig version edits (#3147)
Split out of the original version of this PR per the review comment: one area per PR, table-driven where the set-up is shared. Covers what a suspended actor's v1-stamped MEMORY snapshot restores at after its pool's SandboxConfig changes, on both lanes: | Edit | Restores at | Next snapshot stamped | |---|---|---| | default moves to v2, v1 still Enabled | MEMORY on v1 via restorable_runtimes | v1 | | v1 Disabled | ROOTFS on v2 | v2 | | v1 Disabled, actor moved to another template with UpdateActor | VOLUMES on v2 (template replacement takes precedence) | v2 | | version names swapped (bundles unchanged, with duplicate aliases) | MEMORY; worker lists the hash once | v1 | | assets edited under the same version name | ROOTFS | new hash | | Tag clone after v1 Disabled | ROOTFS on v2 | v2 | The fixture (`setupSuspendedV1Actor`, `updateVersions`, `waitForWorker`, `resumeAndCheck`) is what the follow-up PRs build on: paused actor across version changes, scheduler preferring the compatible pool, WorkerPool configRef changes and bad asset SHA256. The controlapi unit test change seeds a worker with a different default so the snapshot-stamp assertion actually discriminates. AI-assisted, I reviewed and tested it. - [x] Tests pass - [x] Docs updated --------- Signed-off-by: Shrutiya <[email protected]>
1 parent b66e16a commit 24482d5

3 files changed

Lines changed: 626 additions & 1 deletion

File tree

‎cmd/ateapi/internal/controlapi/workflow_suspend_test.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ func TestSuspendActor_MarkedSuspending_SnapshotURI(t *testing.T) {
155155
}
156156
assignment := wireTestAssignment()
157157
assignment.SandboxRuntime = wantRuntime
158+
// Seed the assigned worker with a different current default_runtime to
159+
// verify the snapshot is stamped from WorkerAssignment.sandbox_runtime
160+
// rather than the worker's latest registration.
161+
worker := seedRuntimeWorker(t, ctx, persistence, assignment.GetWorkerPod(), assignment.GetNodeName(), testRuntime("arm64", "v2-hash"))
162+
assignment.Worker = &ateapi.ObjectRef{Name: worker.GetMetadata().GetName()}
163+
assignment.WorkerPodUid = worker.GetWorkerPodUid()
158164
actorRef := resources.ActorRef{Atespace: "team-a", Name: "actor-1"}
159165
storetest.MustCreateActor(t, ctx, persistence, &ateapi.Actor{
160166
Metadata: &ateapi.ResourceMetadata{Atespace: actorRef.Atespace, Name: actorRef.Name},

0 commit comments

Comments
 (0)