Problem
TestDispatchEmptyInputWaitsForRemoteReceiver in pkg/sql/colexec/dispatch/dispatch_test.go:336 fails intermittently:
dispatch_test.go:336: empty dispatch returned before its remote receiver attached
The test verifies that the dispatch operator waits for a remote receiver to attach before returning when input is empty. The dispatch returns prematurely (before receiver attachment), indicating a race condition in the wait logic.
Recent Occurrences
| Date |
PR/Run |
Job |
| 2026-07-14 |
PR #25728 |
UT Test on Ubuntu/x86 |
Root Cause
Race condition between dispatch returning and remote receiver attachment. Under CI runner scheduling variability, the dispatch goroutine may complete before the receiver goroutine attaches.
Suggested Fix
- Add synchronization (channel/WaitGroup) to ensure receiver attachment happens before dispatch checks
- Or increase the wait tolerance in the dispatch wait logic
- Or make the test deterministic by using explicit synchronization instead of timing
Problem
TestDispatchEmptyInputWaitsForRemoteReceiverinpkg/sql/colexec/dispatch/dispatch_test.go:336fails intermittently:The test verifies that the dispatch operator waits for a remote receiver to attach before returning when input is empty. The dispatch returns prematurely (before receiver attachment), indicating a race condition in the wait logic.
Recent Occurrences
Root Cause
Race condition between dispatch returning and remote receiver attachment. Under CI runner scheduling variability, the dispatch goroutine may complete before the receiver goroutine attaches.
Suggested Fix