tests: wait for Running in cloud-hypervisor running-fork path#142
tests: wait for Running in cloud-hypervisor running-fork path#142sjmiller609 wants to merge 36 commits intomainfrom
Conversation
…alizing-concurrency # Conflicts: # lib/instances/qemu_test.go # lib/network/allocate.go # lib/oapi/oapi.go
…alizing-concurrency
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| require.NoError(t, err) | ||
| require.Contains(t, []State{StateInitializing, StateRunning}, forked.State) | ||
| forked, err = waitForInstanceState(ctx, manager, forked.Id, StateRunning, 20*time.Second) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
Forked instance cleanup registered after potential timeout failure
Low Severity
The forked instance's t.Cleanup is registered on line 410, after waitForInstanceState (20s timeout) and two require assertions. If any of those fail, the already-created forked instance leaks. This is inconsistent with the source instance pattern introduced in this same diff, where sourceID is captured and cleanup registered on lines 383–384 before calling waitForInstanceState. The fork's ID is available right after require.NoError on line 404 and the cleanup could be registered there, matching the source pattern.
Additional Locations (1)
|
duplicate PR, rebasing from main |


Summary
TestForkCloudHypervisorFromRunningNetworkflake caused byInitializing/RunningraceRunningbefore running-state fork assertionsInitializingreturn from running fork, then wait toRunningRunningbefore network assertionsValidation
deft-kernel-dev):go test -count=8 -run '^TestForkCloudHypervisorFromRunningNetwork$' -tags containers_image_openpgp -timeout=45m ./lib/instancesNote
Low Risk
Low risk because changes are confined to test timing/expectations, reducing flakiness without altering production logic.
Overview
Improves
TestForkCloudHypervisorFromRunningNetworkreliability by waiting for the source instance to reachStateRunningbefore asserting network reachability and fork behavior.Adjusts the running-fork assertions to accept a transient
StateInitializingreturn fromForkInstance, then polls until the fork reachesStateRunning, and similarly waits for the restored source to return toStateRunningbefore performing post-fork network checks.Written by Cursor Bugbot for commit 32299fc. This will update automatically on new commits. Configure here.