diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2023-02-22 21:06:41 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2023-02-22 21:06:41 +0100 |
commit | 176f17d05ec154ce455ab2bde7429017d43d67fb (patch) | |
tree | 20cec21efa5b14f21c7e3da34633d7c083d29b8f /org.eclipse.jgit.test | |
parent | e92212a5a00c84f5e1dda0b44646ba90c147b4da (diff) | |
parent | f4eda3360a637beb3bc172810d9f9d3abec4360c (diff) | |
download | jgit-176f17d05ec154ce455ab2bde7429017d43d67fb.tar.gz jgit-176f17d05ec154ce455ab2bde7429017d43d67fb.zip |
Merge branch 'stable-6.4'
* stable-6.4:
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: Ia2797b44a60342eb9df53f0b3d674cba92a512fc
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcConcurrentTest.java | 8 |
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); } |