Skip to content

UT[TestTcpConnection]: read write status before queuing request - #181

Open
678098 wants to merge 1 commit into
bloomberg:mainfrom
678098:261109_UT
Open

678098 wants to merge 1 commit into
bloomberg:mainfrom
678098:261109_UT

Conversation

@678098

@678098 678098 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The test thread could get a request and change the write status before write() returned it, so the wrong status was returned for that write. Read the status first and make it volatile.

Fixes the following UT error:

[ERROR] Failures: 
[ERROR] com.bloomberg.bmq.impl.BrokerSessionTest.openConfigureQueueRequestFailsTest
[ERROR]   Run 1: BrokerSessionTest.openConfigureQueueRequestFailsTest:1208 Unexpected type, expected: <com.bloomberg.bmq.impl.events.BrokerSessionEvent> but was: <com.bloomberg.bmq.impl.events.QueueControlEvent>
[ERROR]   Run 2: BrokerSessionTest.openConfigureQueueRequestFailsTest:1208 Unexpected type, expected: <com.bloomberg.bmq.impl.events.BrokerSessionEvent> but was: <com.bloomberg.bmq.impl.events.QueueControlEvent>
[ERROR]   Run 3: BrokerSessionTest.openConfigureQueueRequestFailsTest:1208 Unexpected type, expected: <com.bloomberg.bmq.impl.events.BrokerSessionEvent> but was: <com.bloomberg.bmq.impl.events.QueueControlEvent>
[ERROR]   Run 4: BrokerSessionTest.openConfigureQueueRequestFailsTest:1208 Unexpected type, expected: <com.bloomberg.bmq.impl.events.BrokerSessionEvent> but was: <com.bloomberg.bmq.impl.events.QueueControlEvent>

The test thread could get a request and change the write status
before write() returned it, so the wrong status was returned for
that write. Read the status first and make it volatile.

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
@678098
678098 requested a review from a team as a code owner November 9, 2026 23:17
@678098

678098 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

A similar bug is in ITs here: #173

This branch has not been deployed

No deployments
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.

1 participant