From f9226c2fc26124ece01e9950670cd8204d67d5c1 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 31 Aug 2026 14:16:30 +0200 Subject: [PATCH] Fix #2096: harden NamedLocksTrackingFileManagerTest against CI load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test has 4 threads competing for exclusive file locks across 1000 iterations. On loaded CI machines, the 5-second per-operation timeout can be exceeded due to OS scheduling delays and retry sleep accumulation (100ms between attempts). This test already had its timeout bumped from 1s to 5s in 194128ae for the same reason. Increase the timeout to 30 seconds — generous enough to absorb CI load spikes without masking real deadlocks. Also properly shut down the FileLockNamedLockFactory after each test to close idle FileChannels and clean up lock files. Co-Authored-By: Claude Opus 4.6 --- .../impl/NamedLocksTrackingFileManagerTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/NamedLocksTrackingFileManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/NamedLocksTrackingFileManagerTest.java index fee3b6ce35..7f64248f2b 100644 --- a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/NamedLocksTrackingFileManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/NamedLocksTrackingFileManagerTest.java @@ -21,10 +21,22 @@ import java.util.concurrent.TimeUnit; import org.eclipse.aether.named.providers.FileLockNamedLockFactory; +import org.junit.jupiter.api.AfterEach; public class NamedLocksTrackingFileManagerTest extends TrackingFileManagerTestSupport { + private FileLockNamedLockFactory lockFactory; + @Override protected TrackingFileManager createTrackingFileManager(FS fs) { - return new NamedLocksTrackingFileManager(new FileLockNamedLockFactory(), 5L, TimeUnit.SECONDS); + lockFactory = new FileLockNamedLockFactory(); + return new NamedLocksTrackingFileManager(lockFactory, 30L, TimeUnit.SECONDS); + } + + @AfterEach + void shutdownFactory() { + if (lockFactory != null) { + lockFactory.shutdown(); + lockFactory = null; + } } }