From 60b604f1b077dd63c4a021801835c39c60b3cc19 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:28:14 +0200 Subject: [PATCH] Mute DLQ test on Windows (#15843) (#15845) This commit mutes the DLQ test: `testDLQWriterFlusherRemovesExpiredSegmentWhenCurrentHeadSegmentIsEmpty` when running on Windows. Closes https://github.com/elastic/logstash/issues/15768 (cherry picked from commit c33afd4cd0d94a8f010e56a6bc6772c2cb59e339) Co-authored-by: Dimitrios Liappis --- .../common/io/DeadLetterQueueWriterAgeRetentionTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueWriterAgeRetentionTest.java b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueWriterAgeRetentionTest.java index 4df7483e099..519e92ee5c2 100644 --- a/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueWriterAgeRetentionTest.java +++ b/logstash-core/src/test/java/org/logstash/common/io/DeadLetterQueueWriterAgeRetentionTest.java @@ -26,6 +26,7 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assume.assumeThat; import static org.logstash.common.io.DeadLetterQueueTestUtils.FULL_SEGMENT_FILE_SIZE; import static org.logstash.common.io.DeadLetterQueueTestUtils.GB; import static org.logstash.common.io.DeadLetterQueueTestUtils.MB; @@ -334,8 +335,15 @@ public void testDLQWriterFlusherRemovesExpiredSegmentWhenCurrentWriterIsStale() } } + private static boolean isWindows() { + return System.getProperty("os.name").startsWith("Windows"); + } + @Test public void testDLQWriterFlusherRemovesExpiredSegmentWhenCurrentHeadSegmentIsEmpty() throws IOException { + // https://github.com/elastic/logstash/issues/15768 + assumeThat(isWindows(), is(not(true))); + final Event event = DeadLetterQueueReaderTest.createEventWithConstantSerializationOverhead( Collections.singletonMap("message", "Not so important content"));