Skip to content

Add integration test showcasing resendMessages bug #344 (too-low SequenceReset MsgSeqNum)#1195

Draft
Copilot wants to merge 9 commits intomasterfrom
copilot/showcase-direct-connection-failure
Draft

Add integration test showcasing resendMessages bug #344 (too-low SequenceReset MsgSeqNum)#1195
Copilot wants to merge 9 commits intomasterfrom
copilot/showcase-direct-connection-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

  • Rolled back ResendMessagesBugDirectConnectionTest.java to the state at commit 367788275ff7e2d5e2f3bd4481beca58c538f9e6

…ve acceptor/initiator connection

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/51698dc5-437b-4294-9bc1-1f77b2c74796

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented Apr 24, 2026

@copilot please add logging to the toAdmin/fromAdmin/toApp/fromApp methods in the ApplicationAdapter in the test implementation.

… and TestConnectorApplication

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/f97854dd-c016-45b5-8b11-6d0c47ff8fe6

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot please add logging to the toAdmin/fromAdmin/toApp/fromApp methods in the ApplicationAdapter in the test implementation.

Done in commit 2d30768. Both AcceptorApplication and TestConnectorApplication now have their own Logger and log all four callbacks (toAdmin, fromAdmin, toApp, fromApp) at INFO level with the session ID and message.

@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented Apr 24, 2026

@copilot I cannot see any session-related events being logged in the test. Please pass a LogFactory to the Session.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot I cannot see any session-related events being logged in the test. Please pass a LogFactory to the Session.

Done in commit 68bbb0f. Replaced SLF4JLogFactory(new SessionSettings()) with ScreenLogFactory(settings) in both createAcceptor and createInitiator. ScreenLogFactory writes directly to System.out, so all session-level events (incoming/outgoing messages, state changes) are now visible in the test output.

@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented Apr 27, 2026

@copilot change test as follows:

  • add a heartbeat interval of 5 seconds
  • do not disconnect the session before receiving a heartbeat
  • check that the logout message does not contain a "too low" message

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 27, 2026

@copilot change test as follows:

  • add a heartbeat interval of 5 seconds
  • do not disconnect the session before receiving a heartbeat
    ...

Done in commit fb0c0d5. Changes made:

  • HeartBtInt=5 set on both acceptor and initiator.
  • Heartbeat wait: TestConnectorApplication.fromAdmin now counts down a latch when a Heartbeat arrives that does not have PossDupFlag=Y (i.e. it is a freshly generated heartbeat, not a replayed one). The test waits up to 15 seconds for this before stopping the sessions.
  • Logout check: TestConnectorApplication.toAdmin collects all outgoing Logout messages. After the graceful shutdown (post-finally), the test asserts that none of the captured logouts have a Text field containing "too low" — which is the text doTargetTooLow places in the Logout it generates when the buggy SequenceReset arrives.

…ore generateSequenceResetIfNeeded

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/be2e37cc-175b-4fcb-89ea-6f5c4b7b68b1

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
- Simplify BugScenarioStore: NextSenderMsgSeqNum 11→6, remove absent seqnos 6–10
- Update capture threshold in AcceptorApplication.toAdmin from >10 to >6
- Update test sanity-check assertion from newSeqNo>10 to newSeqNo>6
- Revert Session.java condition to `if (appMessageJustSent)` to expose bug #344

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/5c8e8307-ada1-4ff4-ac56-49ef2abd8957

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
- Add second Heartbeat (seqno 6) to BugScenarioStore; LAST_PREPOPULATED_SEQNO 5→6
- setNextSenderMsgSeqNum 6→7 so the startup Logon uses seqno 7
- Update toAdmin capture threshold from >6 to >7 (NewSeqNo=8 is the buggy reset)
- Update sanity-check assertion from >6 to >7
- Update assertEquals(6) → assertEquals(7) and related comments
- Update all Javadoc to reflect new seqno 6 Heartbeat and seqno 7 Logon

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/6093151b-7a97-484c-a0b4-5528eaae35e7

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
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