Repository navigation
Conversation
Replace the hard-coded 5s/10s/3s update deadlines shared by the provider-update preservation fixtures with a single 60s hang guard, since tight wall-clock deadlines flake under slow Windows -race CI. Drop -race from the Windows provider-update test run: it intermittently crashes net/http server teardown during goroutine stack shrink/copy on windows/amd64 (golang/go#77975, #77955, #78041), still reproducing on go1.26.9. pkg/workspace and pkg/provider keep -race coverage via the Unit Tests job on ubuntu-latest and macos-latest.
✅ Deploy Preview for devsydev canceled.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 29 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for images-devsy-sh canceled.
|
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.
Problem
Two Windows unit-test flakes in
pkg/workspace(job "Provider Update Tests (windows-latest)"), both observed on main/PR CI over the last two days:TestProviderUpdateAbsoluteReferenceUsesFinalStagedTarget/outside_reference_remains_untouched_while_managed_tree_updates:require.NoError(f.t, ctx.Err(), "update must terminate by concrete result, not deadline")failed withcontext deadline exceeded" after 5.76s.preservationFixture.updateboundsupdateProviderwith a hardcontext.WithTimeout(..., 5*time.Second); 5s is too tight for a cold Windows-race` runner under Defender, so the fixture's own guard — not the implementation — fires first.TestProviderUpdateSameNameHTTPFailurePreservesExisting: the whole test binary crashed withException 0xc0000005(PC=0xc0005243c0,runtime: g 152 ...: unknown pc) right after the test's own assertions passed, duringt.Cleanupclosing the ownedhttptest.Server. The crashing PC is literally theg-struct pointer of a different, still-live goroutine (goroutine 151) — i.e. memory that should hold a return address on goroutine 152's stack instead holds another goroutine's object pointer. This matches known upstream Go runtime bugs: windows/amd64 stack corruption under-raceduring goroutine stack shrink/copy, reported in runtime: Windows crash with Go 1.26.0, 1.26.1 golang/go#77975 (Windows crash with Go 1.26.0/1.26.1, fixed in #78041/CL 753480) and runtime: intermittent ACCESS_VIOLATION in (*unwinder).next during shrinkstack on Windows amd64 (Go 1.26.0) golang/go#77955 (ACCESS_VIOLATION inshrinkstack/scanstackon Windows, also reproduced on go1.25.7). Our CI runner is already on go1.26.9 (post-#78041 backport) and still crashes, so this is a distinct, still-open class of the same Windows+race stack-corruption bug family, not a bug in our test or innet/http/httptest(the crash is deep inside Go runtime/stdlib internals, not in anydevsy-owned code path).Fix
3s/5s/10scontext.WithTimeoutused to boundupdateProvider/provider.DownloadBinariescalls in thepkg/workspaceprovider-update preservation fixtures with a single sharedupdateTestHangGuard = 60 * time.Secondconstant — a hang-safety bound, not a target duration, generous enough to never race a slow CI host.-racefrom the Windows provider-updatego testinvocation inhack/provider_update_ci/discovery.go(narrowest viable mitigation for a confirmed upstream Go runtime bug, documented with issue references).pkg/workspaceandpkg/providerkeep full-racecoverage onubuntu-latestandmacos-latestvia the existing "Unit Tests" job, so this does not reduce race coverage, only removes a Windows-only runtime crash that isn't a real data race in our code.Validation
go test -race -count=20 -run 'TestProviderUpdate' ./pkg/workspace/— 20x clean on macOS (does not reproduce the Windows-only runtime crash; included per the review checklist).GOOS=windows go vet ./pkg/workspace/ ./hack/provider_update_ci/...— clean.go test -race -count=1 ./hack/provider_update_ci/...— clean (covers the updated arg-shape test).mise run cli:lint:ci— 0 issues.