From 5d328ba928651aba3c87beb5855e494affa6d2b9 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 3 Jun 2020 10:26:13 +0200 Subject: [PATCH] Suppress debug stacktrace for TestFileSessions.testSweep Signed-off-by: Jan Bartel --- .../eclipse/jetty/server/session/TestFileSessions.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/TestFileSessions.java b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/TestFileSessions.java index 8a4bf0e9590..0b2428db306 100644 --- a/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/TestFileSessions.java +++ b/tests/test-sessions/test-file-sessions/src/test/java/org/eclipse/jetty/server/session/TestFileSessions.java @@ -21,6 +21,8 @@ package org.eclipse.jetty.server.session; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.util.log.Log; +import org.eclipse.jetty.util.log.StacklessLogging; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -255,8 +257,12 @@ public class TestFileSessions extends AbstractTestBase FileTestHelper.createFile(foreignNeverExpired); FileTestHelper.assertFileExists(foreignNeverExpired, true); - //sweep - ((FileSessionDataStore)store).sweepDisk(); + //sweep - we're expecting a debug log with exception stacktrace due to file named + //nonNumber__0.0.0.0_spuriousFile so suppress it + try (StacklessLogging stackless = new StacklessLogging(Log.getLogger("org.eclipse.jetty.server.session"))) + { + ((FileSessionDataStore)store).sweepDisk(); + } //check results FileTestHelper.assertSessionExists("sessiona", false);