This is an automated email from the ASF dual-hosted git repository. reta pushed a commit to branch 3.6.x-fixes in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 6ebc2c794349f2154908b4a781b166e1494dc091 Author: Andriy Redko <[email protected]> AuthorDate: Sat Nov 16 12:22:57 2024 -0500 Fix flakiness in org.apache.cxf.io.DelayedCachedOutputStreamCleanerTest.testCleanOnShutdown test case (cherry picked from commit 3ff5a8f32a51f1de48bb3c5e724db68dae66a68a) (cherry picked from commit fe76857bdfa7d2dd39345b1f1e1aa73dea652de6) --- .../org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java b/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java index 8fcb12cf46..1cd557c1c6 100644 --- a/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java +++ b/core/src/test/java/org/apache/cxf/io/DelayedCachedOutputStreamCleanerTest.java @@ -147,14 +147,13 @@ public class DelayedCachedOutputStreamCleanerTest { @Test public void testCleanOnShutdown() throws InterruptedException { - /* Delay of 2.5 seconds */ - final Map<String, Object> properties = Collections.singletonMap(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); + /* Delay of 5 seconds */ + final Map<String, Object> properties = Collections.singletonMap(CachedConstants.CLEANER_DELAY_BUS_PROP, 5000); bus = new ExtensionManagerBus(new HashMap<>(), properties); final AtomicBoolean latch = new AtomicBoolean(); final Closeable closeable = () -> latch.compareAndSet(false, true); - bus.setProperty(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */ final CachedOutputStreamCleaner cleaner = bus.getExtension(CachedOutputStreamCleaner.class); cleaner.register(closeable); @@ -169,14 +168,13 @@ public class DelayedCachedOutputStreamCleanerTest { public void testCleanOnShutdownDisabled() throws InterruptedException { /* Delay of 2.5 seconds */ final Map<String, Object> properties = new HashMap<>(); - properties.put(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); + properties.put(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */ properties.put(CachedConstants.CLEANER_CLEAN_ON_SHUTDOWN_BUS_PROP, false); bus = new ExtensionManagerBus(new HashMap<>(), properties); final AtomicBoolean latch = new AtomicBoolean(); final Closeable closeable = () -> latch.compareAndSet(false, true); - bus.setProperty(CachedConstants.CLEANER_DELAY_BUS_PROP, 2500); /* 2.5 seconds */ final CachedOutputStreamCleaner cleaner = bus.getExtension(CachedOutputStreamCleaner.class); cleaner.register(closeable);
