This is an automated email from the ASF dual-hosted git repository. hubcio pushed a commit to branch feat/durable-protocol-and-sessions in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 79de990d54470991c9bdc84ebc90f74b51f1050d Author: Hubert Gruszecki <[email protected]> AuthorDate: Mon Oct 5 17:11:07 2026 +0200 test(consensus): preserve pinned receipts in reordered retries After a lower request commits out of order, the higher request ID still owns the retained receipt. Correct the simulator's reversed retry expectations and compare the replayed receipt byte for byte, while asserting neither retry appends another message. --- core/simulator/src/lib.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/simulator/src/lib.rs b/core/simulator/src/lib.rs index 36895ed86..c176dd5d2 100644 --- a/core/simulator/src/lib.rs +++ b/core/simulator/src/lib.rs @@ -3265,9 +3265,9 @@ mod tests { sim.register_client_with_primary(&client); let delayed = client.send_messages(namespace, &[Bytes::from_static(b"delayed")]); let later = client.send_messages(namespace, &[Bytes::from_static(b"later")]); - let committed = + let later_receipt = submit_and_wait_for_reply(&mut sim, client.client_id(), 0, later.deep_copy()); - assert_eq!(committed.header().status, 0); + assert_eq!(later_receipt.header().status, 0); let committed = submit_and_wait_for_reply(&mut sim, client.client_id(), 0, delayed.deep_copy()); assert_eq!(committed.header().status, 0); @@ -3276,10 +3276,17 @@ mod tests { expected.commit_offset, 1, "both reordered requests must append" ); - for (replay, expected_status) in [(delayed, 0), (later, IggyError::RequestTooOld.as_code())] + for (replay, expected_status) in [(delayed, IggyError::RequestTooOld.as_code()), (later, 0)] { let duplicate = submit_and_wait_for_reply(&mut sim, client.client_id(), 0, replay); assert_eq!(duplicate.header().status, expected_status); + if expected_status == 0 { + assert_eq!( + duplicate.as_slice(), + later_receipt.as_slice(), + "the lower request must preserve the higher request's original receipt" + ); + } assert_eq!( sim.offsets(0, namespace), Some(expected),
