Skip to content

Fix instability in diode_test on darwin#765

Open
IDisposable wants to merge 2 commits into
rs:masterfrom
IDisposable:fix/darwin-test-instability
Open

Fix instability in diode_test on darwin#765
IDisposable wants to merge 2 commits into
rs:masterfrom
IDisposable:fix/darwin-test-instability

Conversation

@IDisposable

Copy link
Copy Markdown
Contributor

There's a subtle race condition in the diode_test.go that randomly fails the CI build's test (usually on darwin). This introduces a signal to ensure the diode writer did the write.

Copilot AI review requested due to automatic review settings April 21, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes diode_test.go by removing a race in TestNewWriter where the test could assert on the buffer before the diode’s background goroutine had written the log entry (observed as flaky failures on darwin CI).

Changes:

  • Add a signalBuffer wrapper that signals when a Write has occurred.
  • Update TestNewWriter to wait (with a timeout) for the write signal before closing and asserting output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread diode/diode_test.go
Applied same pattern to the other diode_test methods because now they race. Simplified to remove the sub-process now that zerolog supports replaceable FatalExitFunc
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