diff --git a/artio-core/src/main/java/uk/co/real_logic/artio/engine/logger/ReplayIndex.java b/artio-core/src/main/java/uk/co/real_logic/artio/engine/logger/ReplayIndex.java index 8e419f85ba..06d2c8463e 100644 --- a/artio-core/src/main/java/uk/co/real_logic/artio/engine/logger/ReplayIndex.java +++ b/artio-core/src/main/java/uk/co/real_logic/artio/engine/logger/ReplayIndex.java @@ -621,9 +621,11 @@ void reset() evictionHandler.onReset(fixSessionId); deleteFile(headerFile); - for (final File segmentFile: segmentBufferFiles) + + for (int segmentIndex = 0; segmentIndex < segmentCount; segmentIndex++) { - if (segmentFile != null) + final File segmentFile = replayIndexSegmentFile(fixSessionId, segmentIndex); + if (segmentFile.exists()) { deleteFile(segmentFile); } diff --git a/artio-core/src/test/java/uk/co/real_logic/artio/engine/logger/ReplayIndexTest.java b/artio-core/src/test/java/uk/co/real_logic/artio/engine/logger/ReplayIndexTest.java index 85e3e16e41..dafe3531e4 100644 --- a/artio-core/src/test/java/uk/co/real_logic/artio/engine/logger/ReplayIndexTest.java +++ b/artio-core/src/test/java/uk/co/real_logic/artio/engine/logger/ReplayIndexTest.java @@ -42,7 +42,6 @@ import org.agrona.concurrent.status.AtomicCounter; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.mockito.Mockito; @@ -442,7 +441,6 @@ public void shouldDeleteIndexSegmentsOnSequenceResetWhenNoSegmentsHaveBeenTouche } @Test(timeout = 20_000L) - @Ignore public void shouldDeleteIndexSegmentsOnSequenceResetWhenASegmentHasBeenTouched() { int seqNo = 1;