This is an automated email from the ASF dual-hosted git repository. tkalkirill pushed a commit to branch ignite-26058 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 84bd878888261dfd954e5c61a6373a6bd7b746f6 Author: Kirill Tkalenko <tkalkir...@yandex.ru> AuthorDate: Tue Jul 29 14:47:25 2025 +0300 IGNITE-26058 wip --- .../org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java | 5 +++-- .../ignite/internal/disaster/system/MetastorageRepairImplTest.java | 7 ++++--- .../internal/table/distributed/storage/InternalTableImplTest.java | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java index 4b16d69e1af..9dfe85fe917 100644 --- a/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java +++ b/modules/catalog/src/test/java/org/apache/ignite/internal/catalog/CatalogManagerSelfTest.java @@ -34,6 +34,7 @@ import static org.apache.ignite.internal.testframework.matchers.CompletableFutur import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully; import static org.apache.ignite.internal.util.CompletableFutures.falseCompletedFuture; import static org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture; +import static org.apache.ignite.internal.util.CompletableFutures.trueCompletedFuture; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.is; @@ -203,7 +204,7 @@ public class CatalogManagerSelfTest extends BaseCatalogManagerTest { ComponentContext componentContext = new ComponentContext(); when(updateLogMock.startAsync(componentContext)).thenReturn(nullCompletedFuture()); - when(updateLogMock.append(any())).thenReturn(CompletableFuture.completedFuture(true)); + when(updateLogMock.append(any())).thenReturn(trueCompletedFuture()); CatalogManagerImpl manager = new CatalogManagerImpl(updateLogMock, clockService, new NoOpFailureManager(), delayDuration::get); assertThat(manager.startAsync(componentContext), willCompleteSuccessfully()); @@ -342,7 +343,7 @@ public class CatalogManagerSelfTest extends BaseCatalogManagerTest { when(updateLogMock.startAsync(startComponentContext)).thenReturn(nullCompletedFuture()); when(updateLogMock.stopAsync(stopComponentContext)).thenReturn(nullCompletedFuture()); - when(updateLogMock.append(any())).thenReturn(CompletableFuture.completedFuture(true)); + when(updateLogMock.append(any())).thenReturn(trueCompletedFuture()); CatalogManagerImpl manager = new CatalogManagerImpl(updateLogMock, clockService, new NoOpFailureManager(), delayDuration::get); diff --git a/modules/system-disaster-recovery/src/test/java/org/apache/ignite/internal/disaster/system/MetastorageRepairImplTest.java b/modules/system-disaster-recovery/src/test/java/org/apache/ignite/internal/disaster/system/MetastorageRepairImplTest.java index 04da8bcce99..cc8ef9f4f53 100644 --- a/modules/system-disaster-recovery/src/test/java/org/apache/ignite/internal/disaster/system/MetastorageRepairImplTest.java +++ b/modules/system-disaster-recovery/src/test/java/org/apache/ignite/internal/disaster/system/MetastorageRepairImplTest.java @@ -23,6 +23,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.SECONDS; import static org.apache.ignite.internal.testframework.matchers.CompletableFutureExceptionMatcher.willTimeoutIn; import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willSucceedIn; +import static org.apache.ignite.internal.util.CompletableFutures.emptySetCompletedFuture; import static org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.contains; @@ -103,7 +104,7 @@ class MetastorageRepairImplTest extends BaseIgniteAbstractTest { @Test void hangsIfParticipatingNodesNeverAppear() { - when(cmgManager.validatedNodes()).thenReturn(completedFuture(Set.of())); + when(cmgManager.validatedNodes()).thenReturn(emptySetCompletedFuture()); assertThat(repair.repair(Set.of("node1", "node2"), 1), willTimeoutIn(100, MILLISECONDS)); } @@ -159,7 +160,7 @@ class MetastorageRepairImplTest extends BaseIgniteAbstractTest { @Test void proceedsIfParticipatingNodesAppearAsValidatedLaterThanRepairStarts() { - when(cmgManager.validatedNodes()).thenReturn(completedFuture(Set.of())); + when(cmgManager.validatedNodes()).thenReturn(emptySetCompletedFuture()); doAnswer(invocation -> { LogicalTopologyEventListener listener = invocation.getArgument(0); @@ -176,7 +177,7 @@ class MetastorageRepairImplTest extends BaseIgniteAbstractTest { @Test void proceedsIfParticipatingNodesAppearAsJoinedLaterThanRepairStarts() { - when(cmgManager.validatedNodes()).thenReturn(completedFuture(Set.of())); + when(cmgManager.validatedNodes()).thenReturn(emptySetCompletedFuture()); doAnswer(invocation -> { LogicalTopologyEventListener listener = invocation.getArgument(0); diff --git a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImplTest.java b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImplTest.java index 64825936c68..5083fe4d8eb 100644 --- a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImplTest.java +++ b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImplTest.java @@ -25,6 +25,7 @@ import static org.apache.ignite.internal.table.distributed.storage.InternalTable import static org.apache.ignite.internal.table.distributed.storage.InternalTableImpl.collectRejectedRowsResponses; import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe; import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully; +import static org.apache.ignite.internal.util.CompletableFutures.emptyListCompletedFuture; import static org.apache.ignite.internal.util.CompletableFutures.nullCompletedFuture; import static org.apache.ignite.internal.util.CompletableFutures.trueCompletedFuture; import static org.hamcrest.MatcherAssert.assertThat; @@ -178,7 +179,7 @@ public class InternalTableImplTest extends BaseIgniteAbstractTest { } if (request instanceof ScanRetrieveBatchReplicaRequest) { - return completedFuture(List.of()); + return emptyListCompletedFuture(); } return nullCompletedFuture();