-
Notifications
You must be signed in to change notification settings - Fork 658
Add failing test for ResendRequest not re-sent after failed send (issue #1114) #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
quickfixj-core/src/test/java/quickfix/SessionResendRequestFailureTest.java
Outdated
Show resolved
Hide resolved
quickfixj-core/src/test/java/quickfix/SessionResendRequestFailureTest.java
Outdated
Show resolved
Hide resolved
quickfixj-core/src/test/java/quickfix/SessionResendRequestFailureTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
| // Step 5: Disconnect and reconnect | ||
| session.disconnect("Simulating disconnect", false); | ||
| assertFalse("Session should be disconnected", session.isLoggedOn()); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot the test does not exactly follow the description.
We need a call to Session.generateResendRequest() here, which will in turn trigger sendRaw() which will in turn set the resendRange and show the problematic behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in commit f910c2f. The test now calls Session.generateResendRequest() directly using reflection after disconnect, which triggers sendResendRequest() → sendRaw() (fails) → state.setResendRange() (still called), demonstrating the bug exactly as described.
Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Add failing test for ResendRequest bug #1114
Session.generateResendRequest()using reflectioncallGenerateResendRequest()helper method to invoke the private method via reflectionsendResendRequest()callssendRaw()and then sets ResendRange regardless ofsendRaw()return valueTest Status
✅ Test successfully demonstrates the bug
Session.generateResendRequest()which triggers:generateResendRequest()→sendResendRequest()→sendRaw()(returns false) →state.setResendRange()(still called!)Session.sendResendRequest()Original prompt
Context
This PR adds a failing unit test to demonstrate the bug reported in issue #1114: #1114
Problem Summary:
When a QuickFIX session disconnects after a ResendRequest is triggered but before it's actually sent (because
responderbecomes null), theResendRangeis still marked as "sent" even thoughsendRaw()returnsfalse. On reconnection, the ResendRequest is never re-sent because the engine thinks it was already sent.Task
Create a new test file
quickfixj-core/src/test/java/quickfix/SessionResendRequestFailureTest.javawith the following content: