-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(onboard): revalidate managed sandbox identity without waits #10512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+214
−18
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
29ae6f8
fix(onboard): debounce the transient Error phase before registry publ…
hunglp6d 8a7458b
fix(onboard): revalidate managed sandbox identity without waits
sandl99 ca2c993
test(onboard): remove redundant lifecycle coverage
sandl99 193722d
merge(main): synchronize current base
sandl99 b79e9f8
test(e2e): remove stale Hermes placeholder probe
sandl99 64cdd53
test(e2e): restore Hermes GPU coverage
sandl99 c3b37af
fix(onboard): verify managed sandbox after readiness
sandl99 70acf01
Merge branch 'main' into fix/debounce-created-sandbox-revalidation
sandl99 6c09936
test(onboard): cover managed registration boundary
sandl99 15a4ee4
merge: resolve conflicts with main
github-actions[bot] 6d414cd
test(onboard): simplify managed registration coverage
sandl99 ba11bce
test(onboard): preserve managed registration coverage
sandl99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
99 changes: 99 additions & 0 deletions
99
src/lib/onboard/sandbox-create/managed-bootstrap-registration.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import { describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { createOnboardCreatedSandboxRegistration } from "../created-sandbox-finalization"; | ||
| import { | ||
| createCreatedSandboxLifecycle, | ||
| type SandboxRecreateObservation, | ||
| } from "../sandbox-recreate-transaction"; | ||
| import { createOnboardCreatedSandboxRegistrationWithManagedLifecycle } from "./orchestration"; | ||
|
|
||
| describe("managed bootstrap sandbox registration", () => { | ||
| const lifecycleGeneration = "generation-1"; | ||
| const durableIdentity = "a".repeat(64); | ||
| const recordedRegistration = { | ||
| lifecycleGeneration, | ||
| lifecycleLiveIdentityFingerprint: durableIdentity, | ||
| }; | ||
|
|
||
| function registrationFixture(managedBootstrap: boolean, observation: SandboxRecreateObservation) { | ||
| const publish = vi.fn(); | ||
| const runtime = { | ||
| targetGeneration: undefined, | ||
| registrationFields: {}, | ||
| recordCreated: vi.fn(), | ||
| } as never; | ||
| const completeRegistration = createOnboardCreatedSandboxRegistrationWithManagedLifecycle({ | ||
| sandboxName: "alpha", | ||
| managedBootstrap, | ||
| sandboxGpuEnabled: false, | ||
| createdLifecycle: createCreatedSandboxLifecycle( | ||
| runtime, | ||
| { sandboxName: "alpha", gatewayName: "nemoclaw" }, | ||
| () => observation, | ||
| lifecycleGeneration, | ||
| ), | ||
| getRecordedRegistration: () => recordedRegistration, | ||
| createRegistration: createOnboardCreatedSandboxRegistration, | ||
| registration: { | ||
| completion: { | ||
| complete: async ( | ||
| _created, | ||
| _configuredReceipt, | ||
| _providerGpuDisposition, | ||
| _manageDashboard, | ||
| resolveLifecycleRegistrationFields, | ||
| lifecycle, | ||
| ) => { | ||
| const verified = lifecycle.revalidate( | ||
| lifecycle.capture(resolveLifecycleRegistrationFields()), | ||
| ); | ||
| publish(lifecycle.revalidate(verified)); | ||
| }, | ||
| }, | ||
| cleanupBuildContext: vi.fn(), | ||
| manageDashboard: false, | ||
| sandboxGpuEnabled: false, | ||
| }, | ||
| }); | ||
| return { | ||
| complete: () => | ||
| completeRegistration( | ||
| { lifecycleRegistrationFields: { lifecycleGeneration } } as never, | ||
| null, | ||
| ), | ||
| publish, | ||
| }; | ||
| } | ||
|
|
||
| it("publishes a managed sandbox when its not Ready identity matches (#10512)", async () => { | ||
| const fixture = registrationFixture(true, { | ||
| state: "not_ready", | ||
| liveIdentityFingerprint: durableIdentity, | ||
| }); | ||
|
|
||
| await expect(fixture.complete()).resolves.toBeUndefined(); | ||
| expect(fixture.publish).toHaveBeenCalledExactlyOnceWith(recordedRegistration); | ||
| }); | ||
|
|
||
| it.each([ | ||
| ["ordinary", false, { state: "not_ready" as const, liveIdentityFingerprint: durableIdentity }], | ||
| ["missing", true, { state: "not_ready" as const, liveIdentityFingerprint: null }], | ||
| [ | ||
| "malformed", | ||
| true, | ||
| { state: "not_ready" as const, liveIdentityFingerprint: "not-a-fingerprint" }, | ||
| ], | ||
| ["changed", true, { state: "not_ready" as const, liveIdentityFingerprint: "b".repeat(64) }], | ||
| ])( | ||
| "does not publish a %s sandbox from an invalid not Ready observation (#10512)", | ||
| async (_case, managedBootstrap, observation) => { | ||
| const fixture = registrationFixture(managedBootstrap, observation); | ||
|
|
||
| await expect(fixture.complete()).rejects.toThrow(); | ||
| expect(fixture.publish).not.toHaveBeenCalled(); | ||
| }, | ||
| ); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.