From 239c9fcc6b71396c9b249ff33ec34eb27c1f305b Mon Sep 17 00:00:00 2001 From: Luciano Viana Date: Mon, 21 Oct 2024 12:49:59 +0200 Subject: [PATCH] fixing another indeterminism around index update --- .../artio/system_tests/BinaryEntryPointSystemTest.java | 7 ++++--- .../artio/system_tests/MessageBasedAcceptorSystemTest.java | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/artio-binary-entrypoint-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/BinaryEntryPointSystemTest.java b/artio-binary-entrypoint-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/BinaryEntryPointSystemTest.java index 98381209da..7c025e7a9f 100644 --- a/artio-binary-entrypoint-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/BinaryEntryPointSystemTest.java +++ b/artio-binary-entrypoint-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/BinaryEntryPointSystemTest.java @@ -451,9 +451,6 @@ public void shouldAcceptReEstablishmentOfSession() throws IOException restartArtio(); - // if not this, then sometimes the 'alreadyRecvMsgCount' does not match 'nextSeqNo' below when calling - // readEstablishAck - awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library); reEstablishConnection(3, 3); } @@ -2193,6 +2190,10 @@ private void withReEstablishedConnection( { try (BinaryEntryPointClient client = newClient()) { + // if not this, then sometimes the 'alreadyRecvMsgCount' does not match 'nextSeqNo' below when calling + // readEstablishAck + awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library); + final int nextSeqNo = alreadyRecvMsgCount + 1; client.writeEstablish(nextSeqNo); diff --git a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java index a652417deb..d6498740f3 100644 --- a/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java +++ b/artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedAcceptorSystemTest.java @@ -601,6 +601,10 @@ public void shouldSupportLogonBasedSequenceNumberResetWithMessagesSentBeforeLogo testSystem.awaitMessageOf(otfAcceptor, EXECUTION_REPORT_MESSAGE_AS_STR, msg -> msg.messageSequenceNumber() == seqNum2 && msg.sequenceIndex() == 1); + // to ensure the indexes are processed before resend request is received - which would mean a gapfill + // responded rather than a replay msg + awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library); + connection.sendResendRequest(2, 2); testSystem.awaitBlocking( () -> assertEquals(Side.SELL, connection.readResentExecutionReport(2).sideAsEnum()));