Skip to content

test: bump remaining 1ms channel-wait timeouts to 1s - #421

Open
aaron-zeisler wants to merge 2 commits into
v7from
aaronz/fix-remaining-1ms-channel-timeouts
Open

test: bump remaining 1ms channel-wait timeouts to 1s#421
aaron-zeisler wants to merge 2 commits into
v7from
aaronz/fix-remaining-1ms-channel-timeouts

Conversation

@aaron-zeisler

@aaron-zeisler aaron-zeisler commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Bumps the remaining hardcoded time.Millisecond channel-wait timeouts to time.Second. This is a follow-up to #420

Background

A repo-wide grep for time.Millisecond used with AssertChannelClosed/RequireValue/WaitForUpsert/WaitForInit/WaitForNextInit found six more call sites carrying the same 1ms-timeout pattern already identified as a source of CI flakiness under -race on slower runners (see #420, which fixes the same pattern in testhelpers/ldtestdata). These sites haven't been observed failing yet, but they wait on a channel populated by a producer goroutine with effectively no margin, so they carry the same latent risk. This closes out the pattern across the rest of the repo.

Changes

  • ldclient_listeners_fdv2_test.go, ldclient_listeners_test.go, testhelpers/ldtestdatav2/test_data_source_test.go, internal/flag_tracker_impl_test.go, internal/broadcasters_test.go, ldfiledatav2/file_data_source_test.go: bump time.Millisecondtime.Second on AssertChannelClosed calls.

Note

Low Risk
Test-only timeout adjustments with no runtime behavior changes.

Overview
Follow-up to #420: every remaining th.AssertChannelClosed call that used time.Millisecond now uses time.Second, so tests wait longer for listener removal and synchronizer shutdown to close channels.

Touches broadcaster unregister tests, flag tracker listener tests (internal and ldclient v1/v2), file data source close behavior, and ldtestdatav2 synchronizer close tests. No production code changes—only test timing.

Reviewed by Cursor Bugbot for commit 68f0b7f. Bugbot is set up for automated code reviews on this repo. Configure here.

aaron-zeisler and others added 2 commits July 13, 2026 15:23
These tests pass a hardcoded time.Millisecond timeout to
AssertChannelClosed, which waits on a channel closed by a producer
goroutine. Under -race on slower or loaded CI runners, 1ms leaves no
margin and the wait can time out before the close is observed even
though nothing is wrong. Bump these to time.Second, matching the fix
already applied elsewhere for the same pattern, while still failing
fast on a genuine hang.
@aaron-zeisler
aaron-zeisler marked this pull request as ready for review July 16, 2026 16:42
@aaron-zeisler
aaron-zeisler requested a review from a team as a code owner July 16, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants