aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-02-22 20:35:01 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-02-22 20:38:29 +0100
commit1691e38779d1f1d25cc6c388a91a82667ff12b34 (patch)
treecd296fe80513ebf233555a8894907583eee68afc
parent49f527386723ff219de0c726d74f200d89c959d7 (diff)
downloadjgit-1691e38779d1f1d25cc6c388a91a82667ff12b34.tar.gz
jgit-1691e38779d1f1d25cc6c388a91a82667ff12b34.zip
Fix GcConcurrentTest#testInterruptGc
With the new GC.PidLock interrupting a running GC throws a ClosedByInterruptException. Change-Id: I7ccea1ae9a43d4edfdab2fcfd1324c64cc22b38f
-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 5cac1e3429..d53d5eb4b8 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);
}