fix: eliminate race condition in TestBroadcastEvent_Delivery#6
Merged
darkliquid merged 3 commits intofeat/protojsonfrom Mar 15, 2026
Merged
fix: eliminate race condition in TestBroadcastEvent_Delivery#6darkliquid merged 3 commits intofeat/protojsonfrom
darkliquid merged 3 commits intofeat/protojsonfrom
Conversation
Merged
Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix IPC JSON-RPC unification issues
fix: eliminate race condition in TestBroadcastEvent_Delivery
Mar 15, 2026
There was a problem hiding this comment.
Pull request overview
Stabilizes TestBroadcastEvent_Delivery in internal/ipc by ensuring the server has registered the newly-dialed connection before broadcasting, preventing occasional lost broadcasts due to a connection-tracking race.
Changes:
- Add a polling wait after dialing to ensure
srv.connscontains the connection before callingBroadcastEvent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
darkliquid
added a commit
that referenced
this pull request
Mar 15, 2026
* feat: unify IPC JSON-RPC * fix: add missing js * fix: add missing files * ipc: enforce max frame size on write path (#4) * Initial plan * fix: add max frame size check in WriteEnvelope Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> * ipc: address post-review feedback on unified JSON-RPC layer (#5) * Initial plan * fix: address all IPC review feedback - naming, forward-compat, connection-drop cleanup, and broadcast tests Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update internal/ipc/extra_test.go * Update internal/ipc/extra_test.go --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> Co-authored-by: Andrew Montgomery <darkliquid@darkliquid.co.uk> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: eliminate race condition in TestBroadcastEvent_Delivery (#6) * Initial plan * fix: resolve race condition in TestBroadcastEvent_Delivery Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> Co-authored-by: Andrew Montgomery <darkliquid@darkliquid.co.uk> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: darkliquid <31256+darkliquid@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TestBroadcastEvent_Deliverywas flaky under load:BroadcastEventfired immediately afterdialUnixWithRetryreturned, before the server'sservegoroutine had processedAccept()+trackConn(). The broadcast hit an emptyconnsmap and was lost, causing a 5-second timeout.Fix
srv.connsuntil the server has registered the connection before callingBroadcastEventDeterministic and no arbitrary sleeps —
package ipctest access to unexported fields makes this straightforward.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.