Add regression test for chunked ResendRequest boundaries and queue drain#1156
Draft
Add regression test for chunked ResendRequest boundaries and queue drain#1156
Conversation
…romAppCalledForQueuedAppMessages and supporting code Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit test for chunked resend request and queue drain
Add regression test for chunked ResendRequest boundaries and queue drain in FIX42 sessions
Mar 6, 2026
Member
|
There is a race condition but I still need to think about how this can be shown in unit test. After setting the next expected seqnum there is a chance that the queue of messages is emptied before the messages get read via nextQueued(). |
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.
Adds a regression test covering the end-to-end flow where incoming application messages arrive far ahead of the expected target sequence number on a FIX 4.2 session with chunked resend requests, verifying that chunk boundaries are correct and that queued messages are drained and delivered to
fromApp()once the gap is filled.Changes
New test:
testChunkedResendRequestBoundariesAndQueueDrain_FIX42_chunk2500_fromAppCalledForQueuedAppMessagesresendRequestChunkSize=2500, expected seqnum advanced to5798961989–62001), all queued; verifies none are delivered tofromApp()before the gap is filledbeginSeqNo=57989,currentEndSeqNo=60488SequenceReset GapFill(57989→60489): asserts second chunkbeginSeqNo=60489,currentEndSeqNo=61988SequenceReset GapFill(60489→61989): asserts queue empty andfromApp()called for all 13 queued seqnumsSupporting additions
createFix42AppMessage(int)— FIX42-specificNewsmessage helper; required because generated message classes embed their protocol'sBeginStringin the header andSession.next()validates it against the session version, making FIX44 helpers incompatible with FIX42 sessionsCountingApplication— minimalApplicationimplementation trackingfromAppCountandfromAppSeqNumsjava.util.Set/java.util.HashSetimportsDesign note
The final GapFill uses
NewSeqNo=61989(the first queued message) rather than a value past all queued messages. Using a higherNewSeqNowould causedequeueMessagesUpTo()to silently discard the queued application messages beforenextQueued()has a chance to deliver them.Original prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.