This is an automated email from the ASF dual-hosted git repository. XiaoHongbo-Hope pushed a commit to branch release-2.1 in repository https://gitbox.apache.org/repos/asf/paimon.git
commit 08f3fa8bdf8cdb552becd96c1f681c502a34ddf4 Author: Xingyi Lee <[email protected]> AuthorDate: Sat Sep 12 21:37:52 2026 +0800 [core] Add interrupt coverage for snapshot existence retries (#9745) --- .../org/apache/paimon/utils/SnapshotManagerTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java b/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java index 1d30c0f882..c6dddc6dca 100644 --- a/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/utils/SnapshotManagerTest.java @@ -121,6 +121,25 @@ public class SnapshotManagerTest { Mockito.verify(fileIO, Mockito.times(3)).exists(Mockito.any(Path.class)); } + @Test + public void testSnapshotExistsRestoresInterruptedStatus() throws IOException { + FileIO fileIO = Mockito.mock(FileIO.class); + Mockito.when(fileIO.exists(Mockito.any(Path.class))) + .thenThrow(new IOException("Temporary failure")); + SnapshotManager snapshotManager = newSnapshotManager(fileIO, new Path(tempDir.toString())); + + Thread.currentThread().interrupt(); + try { + assertThatThrownBy(() -> snapshotManager.snapshotExists(2)) + .hasMessageContaining("Interrupted while checking whether snapshot #2 exists") + .hasCauseInstanceOf(InterruptedException.class); + assertThat(Thread.currentThread().isInterrupted()).isTrue(); + Mockito.verify(fileIO).exists(Mockito.any(Path.class)); + } finally { + Thread.interrupted(); + } + } + @ParameterizedTest @ValueSource(booleans = {true, false}) public void testEarliestSnapshot(boolean isRaceCondition) throws IOException {
