Skip to content

Commit dcdb9fc

Browse files
committed
feat(at): resendRequestChunkSize special suite
Add a resend_chunk_size tweak and a scenario verifying that, with a configured chunk size, gap detection produces a bounded ResendRequest (EndSeqNo = BeginSeqNo + chunk - 1) rather than an open-ended 2..0 request. chunk=5 with expected=2/received=10 yields ResendRequest 2..=6. 21 distinct scenarios / 35 scenario runs, all green. fmt clean, clippy -D warnings clean, 123 tests.
1 parent 8f96161 commit dcdb9fc

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

crates/truefix-at/src/runner.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ pub struct SessionTweaks {
6262
pub enable_last_processed: bool,
6363
/// Enable CheckLatency (stale SendingTime aborts the session).
6464
pub check_latency: bool,
65+
/// ResendRequest chunk size (0 = request the whole range at once).
66+
pub resend_chunk_size: u32,
6567
}
6668

6769
/// A scripted acceptance-test scenario.
@@ -106,6 +108,7 @@ pub async fn start_acceptor(
106108
template.check_latency = tweaks.check_latency;
107109
template.enable_next_expected_msg_seq_num = tweaks.enable_next_expected;
108110
template.enable_last_msg_seq_num_processed = tweaks.enable_last_processed;
111+
template.resend_request_chunk_size = tweaks.resend_chunk_size;
109112

110113
// Enable dictionary validation so field-level reject scenarios produce Reject messages.
111114
let validator = match version {

crates/truefix-at/src/scenarios.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,26 @@ fn garbled_message_dropped(v: &str) -> Scenario {
414414
)
415415
}
416416

417+
/// Special suite — resendRequestChunkSize: when a gap is detected, the ResendRequest is bounded to
418+
/// one chunk (EndSeqNo = BeginSeqNo + chunk - 1) instead of an open-ended range.
419+
fn resend_request_chunk_size(v: &str) -> Scenario {
420+
scenario_with(
421+
"special_ResendRequestChunkSize",
422+
v,
423+
vec![
424+
Step::Send(logon(v, 1, true)),
425+
Step::Expect(ExpectMsg::of("A")),
426+
Step::Send(client_message(v, "0", 10)), // gap: expected 2, received 10
427+
// chunk=5 → request only 2..=6 rather than 2..0 (open-ended).
428+
Step::Expect(ExpectMsg::of("2").field(7, "2").field(16, "6")),
429+
],
430+
SessionTweaks {
431+
resend_chunk_size: 5,
432+
..SessionTweaks::default()
433+
},
434+
)
435+
}
436+
417437
/// The (representative) server acceptance-test suite across [`SUITE_VERSIONS`].
418438
pub fn server_suite() -> Vec<Scenario> {
419439
let mut out = Vec::new();
@@ -441,5 +461,6 @@ pub fn server_suite() -> Vec<Scenario> {
441461
out.push(last_msg_seq_num_processed("FIX.4.4"));
442462
out.push(check_latency_timestamps("FIX.4.4"));
443463
out.push(garbled_message_dropped("FIX.4.4"));
464+
out.push(resend_request_chunk_size("FIX.4.4"));
444465
out
445466
}

0 commit comments

Comments
 (0)