fix(test): wait for iperf server migration before continuity checks#2649
Open
nevermarine wants to merge 1 commit into
Open
fix(test): wait for iperf server migration before continuity checks#2649nevermarine wants to merge 1 commit into
nevermarine wants to merge 1 commit into
Conversation
verifyIPerfContinuityAfterUpgrade fetched the iperf-server VM immediately, but the post-upgrade workload migration is asynchronous and may start several minutes after the module becomes Ready. Status.MigrationState was still nil, so getIPerfClientReport panicked dereferencing it. Wait for the live migration to succeed before reading MigrationState, and guard the dereference so a future regression fails with a clear message. Signed-off-by: Maksim Fedotov <maksim.fedotov@flant.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & why
The post-upgrade release smoke test panicked with a nil-pointer dereference:
Root cause:
getIPerfClientReportdereferencesiperfServer.Status.MigrationState(a*VirtualMachineMigrationState).verifyIPerfContinuityAfterUpgradefetched the iperf-server VM immediately, but the post-upgrade workload update live-migrates the VM asynchronously — the migration can start several minutes after the module becomes Ready. At the time of the checkMigrationStatewas stillnil, causing the panic. The test never waited for the migration to happen.This assertion is test-only and was added recently (#2617); it is not a product regression.
Fix (test-only)
waitForIPerfServerMigrationintest/e2e/release/iperf.go(styled likewaitForIPerfServerToStart) that polls the iperf-server VirtualMachine viaf.Clients.VirtClient()untilStatus.MigrationState != nil,Result == MigrationResultSucceeded, and bothStartTimestamp/EndTimestampare non-zero. Usesframework.MaxTimeout/framework.PollingInterval.verifyIPerfContinuityAfterUpgradenow waits for the migration (newBy(...)step) and passes the fully-populated VM togetIPerfClientReport.getIPerfClientReportgets an explicitExpect(...MigrationState).NotTo(BeNil(), ...)guard so a future regression fails with a clear message instead of a panic.Verification
go build ./release/...andgo vet ./release/...pass.golangci-lint fmt ./release/...(gofumpt/gci/goimports) reports no changes. Note:golangci-lint runcurrently panics in this environment due to a Go toolchain vs linter version mismatch (Go 1.26 vs linter built with Go 1.25) during package type-checking — unrelated to this change.