aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-02-22 21:03:22 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-02-22 21:03:22 +0100
commit6cc741aa233c4f27f25979bc18145551e75c5ae1 (patch)
treef3ceb1f373647f8165bcd83df87ef42dc834b838 /org.eclipse.jgit.test
parent628ca9bd6f5b4ce26181aaa14d7c464c767321b6 (diff)
parentb526829fba80af0dd0e4a3289ddf18a4f417da05 (diff)
downloadjgit-6cc741aa233c4f27f25979bc18145551e75c5ae1.tar.gz
jgit-6cc741aa233c4f27f25979bc18145551e75c5ae1.zip
Merge branch 'stable-6.1' into stable-6.2
* stable-6.1: If tryLock fails to get the lock another gc has it Fix GcConcurrentTest#testInterruptGc Don't swallow IOException in GC.PidLock#lock Check if FileLock is valid before using or releasing it Change-Id: I3ffe92566cc145053bb762f612dd96bc6d542c62
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java
index 2c5f1a8eba..5f52e6b220 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java
@@ -14,10 +14,10 @@ import static java.lang.Integer.valueOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
+import java.nio.channels.ClosedByInterruptException;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.BrokenBarrierException;
@@ -226,10 +226,8 @@ public class GcConcurrentTest extends GcTestCase {
if (cause instanceof CancelledException) {
assertEquals(JGitText.get().operationCanceled,
cause.getMessage());
- } else if (cause instanceof IOException) {
- Throwable cause2 = cause.getCause();
- assertTrue(cause2 instanceof InterruptedException
- || cause2 instanceof ExecutionException);
+ } else if (cause instanceof ClosedByInterruptException) {
+ // thread was interrupted
} else {
fail("unexpected exception " + e);
}