test(ldtestdata): increase channel-wait timeouts to reduce CI flakiness#420
Open
aaron-zeisler wants to merge 1 commit into
Open
test(ldtestdata): increase channel-wait timeouts to reduce CI flakiness#420aaron-zeisler wants to merge 1 commit into
aaron-zeisler wants to merge 1 commit into
Conversation
test_data_source_test.go and test_data_source_flag_test.go passed a hardcoded time.Millisecond timeout to WaitForUpsert/WaitForInit/ WaitForNextInit/AssertChannelClosed, which wait on a channel populated by a producer goroutine. Under -race on slower CI runners (observed on Windows, Go 1.26), 1ms isn't enough margin and the wait can time out before the value is delivered even though nothing is wrong. Bump these to time.Second, which still fails fast on a genuine hang.
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.
Summary
Increases hardcoded
time.Millisecondchannel-wait timeouts intesthelpers/ldtestdatatotime.Secondto fix intermittent CI flakiness.Background
TestFlagTargets/user_targetsintermittently failed in CI (observed on the Windows, Go 1.26 job) with:Sibling jobs in the same CI run (Windows Go 1.24/1.25, all Linux jobs) passed with the identical test suite, confirming this is a timing flake rather than a real regression. Several test call sites in
test_data_source_flag_test.goandtest_data_source_test.gopass a hardcodedtime.Millisecondtimeout toWaitForUpsert/WaitForInit/WaitForNextInit/AssertChannelClosed, which wait on a channel populated by a producer goroutine. Undergo test -raceon slower/jitterier runners, 1ms isn't enough margin. This pattern dates back to a 2020 commit and has just been latent until now.No behavior change is intended — only the timeout values increase, so tests will still fail fast (within a second) on a genuine hang.
Note
Low Risk
Test-only timeout tuning with no production or behavioral changes; genuine hangs still fail within one second.
Overview
Raises channel-wait deadlines from
time.Millisecondtotime.Secondintesthelpers/ldtestdatatests that block on mock data-source updates.Affected helpers include
WaitForUpsert,WaitForInit,WaitForNextInit, andAssertChannelClosedintest_data_source_test.goand the sharedverifyFlagpath intest_data_source_flag_test.go. Assertions and production code are unchanged; only how long tests wait before failing on a missing channel message.Reviewed by Cursor Bugbot for commit 96abc03. Bugbot is set up for automated code reviews on this repo. Configure here.