Skip to content

test: add SendToChannel helper and replace bare channel sends in functional tests#9876

Merged
spkane31 merged 1 commit intomainfrom
spk/send-to-channel-test
Apr 9, 2026
Merged

test: add SendToChannel helper and replace bare channel sends in functional tests#9876
spkane31 merged 1 commit intomainfrom
spk/send-to-channel-test

Conversation

@spkane31
Copy link
Copy Markdown
Contributor

@spkane31 spkane31 commented Apr 8, 2026

What changed?

Added a SendToChannel(ctx, ch) helper to FunctionalTestBase, mirroring the existing WaitForChannel, and replaced all bare ch <- struct{}{} sends in functional test bodies with calls to it.

Why?

Bare channel sends in test bodies silently hang when the receiving goroutine has stalled or died, causing tests to block until the overall test timeout rather than failing fast with a useful message. WaitForChannel already existed to solve this for receives, SendToChannel closes the gap for sends.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

None, this is a pure test-helper addition.

@spkane31 spkane31 requested review from a team as code owners April 8, 2026 21:56
@spkane31 spkane31 requested a review from stephanos April 8, 2026 21:59
@spkane31 spkane31 merged commit 2993285 into main Apr 9, 2026
46 checks passed
@spkane31 spkane31 deleted the spk/send-to-channel-test branch April 9, 2026 15:03
stephanos pushed a commit that referenced this pull request Apr 13, 2026
…tional tests (#9876)

## What changed?
Added a `SendToChannel(ctx, ch)` helper to `FunctionalTestBase`,
mirroring the existing `WaitForChannel`, and replaced all bare `ch <-
struct{}{}` sends in functional test bodies with calls to it.

## Why?
Bare channel sends in test bodies silently hang when the receiving
goroutine has stalled or died, causing tests to block until the overall
test timeout rather than failing fast with a useful message.
`WaitForChannel` already existed to solve this for receives,
`SendToChannel` closes the gap for sends.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
None, this is a pure test-helper addition.
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