-
Notifications
You must be signed in to change notification settings - Fork 0
Replace time.Sleep with channel synchronization in dial timeout test #11
Copy link
Copy link
Open
Labels
area/transportBinding, protocol, connector, or transport runtime changes.Binding, protocol, connector, or transport runtime changes.good first issueSmall, well-scoped tasks for new contributors.Small, well-scoped tasks for new contributors.help wantedLooking for community contributions.Looking for community contributions.kind/testsTesting, CI, or verification-only changes.Testing, CI, or verification-only changes.priority/lowNice-to-have or backlog item.Nice-to-have or backlog item.
Metadata
Metadata
Assignees
Labels
area/transportBinding, protocol, connector, or transport runtime changes.Binding, protocol, connector, or transport runtime changes.good first issueSmall, well-scoped tasks for new contributors.Small, well-scoped tasks for new contributors.help wantedLooking for community contributions.Looking for community contributions.kind/testsTesting, CI, or verification-only changes.Testing, CI, or verification-only changes.priority/lowNice-to-have or backlog item.Nice-to-have or backlog item.
Problem statement
TestCallWithTimeoutPropagatesParentCancellationWhenCallbackIgnoresContextindial_test.go:110usestime.Sleep(10 * time.Millisecond)to wait for the callback goroutine to start before cancelling the parent context. This is a race condition — on slow CI machines, the goroutine might not have started in 10ms, causing the cancellation to fire before the callback is running.Proposed change
Replace the sleep with a
startedchannel for deterministic synchronization:Affected area
runtime/*Compatibility / migration
Test-only change. No behavior change.
Alternatives considered
Additional context
The other timing-based tests use 20x safety margins (10ms timeout, 200ms assertion threshold) which is reasonable. This specific test is the only one using sleep-based synchronization. Identified during test quality review.