Skip to content

test(amqp091): fix race in Publish_ContextCancellation_ExitsPromptly#78

Open
miotte wants to merge 2 commits into
mainfrom
pr-miotte-tests
Open

test(amqp091): fix race in Publish_ContextCancellation_ExitsPromptly#78
miotte wants to merge 2 commits into
mainfrom
pr-miotte-tests

Conversation

@miotte
Copy link
Copy Markdown
Contributor

@miotte miotte commented May 13, 2026

No description provided.

miotte added 2 commits May 13, 2026 02:52
Use two distinct buffered channels for the connection's two NotifyClose
mock calls instead of aliasing both onto a single channel.  Sharing one
channel made Publish's deferred "Publish done" send wake the
connectionWatcher goroutine, which then raced with the test's deferred
NewAmqpConn091 restore as it called bd.connect() again.  In production
these are independent channels too.

Signed-off-by: Michael Otteni <MichaelGOtteni@gmail.com>
Add Test_QueueSubscribe_NotifyCloseChannelsAreBuffered, mirroring the
existing Publish-path test, so a future regression that re-introduces
unbuffered NotifyClose channels in queueSubscribe is caught immediately.

Also clarifies the comment on the Publish-path buffered-channel assertion
to call out that capacity is only verified on the Publish-created channel
(the last capture).

Signed-off-by: Michael Otteni <MichaelGOtteni@gmail.com>
@miotte miotte force-pushed the pr-miotte-tests branch from c1e2832 to d48a202 Compare May 13, 2026 02:53
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