This is an automated email from the ASF dual-hosted git repository.

rpuch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new d16498ca1d8 IGNITE-25224 Close ClusterTime in 
MetaStorageLeaderElectionListenerTest (#5680)
d16498ca1d8 is described below

commit d16498ca1d84c273d5779bf08aa309b13dd1e5c3
Author: Roman Puchkovskiy <[email protected]>
AuthorDate: Wed Apr 23 18:52:30 2025 +0400

    IGNITE-25224 Close ClusterTime in MetaStorageLeaderElectionListenerTest 
(#5680)
---
 .../apache/ignite/internal/index/IndexBuildController.java   |  2 +-
 .../impl/MetaStorageLeaderElectionListenerTest.java          | 12 ++++++++++--
 .../internal/metastorage/server/time/ClusterTimeTest.java    |  2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
index 499084adba9..c9cd072538b 100644
--- 
a/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
+++ 
b/modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildController.java
@@ -236,7 +236,7 @@ class IndexBuildController implements ManuallyCloseable {
 
             return CompletableFutures.allOf(startBuildIndexFutures);
         }).whenComplete((res, ex) -> {
-            if (ex != null) {
+            if (ex != null && !hasCause(ex, NodeStoppingException.class)) {
                 failureProcessor.process(new 
FailureContext(FailureType.CRITICAL_ERROR, ex));
             }
         });
diff --git 
a/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/impl/MetaStorageLeaderElectionListenerTest.java
 
b/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/impl/MetaStorageLeaderElectionListenerTest.java
index 9bed8fb9c4f..1678bc8dabd 100644
--- 
a/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/impl/MetaStorageLeaderElectionListenerTest.java
+++ 
b/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/impl/MetaStorageLeaderElectionListenerTest.java
@@ -43,16 +43,24 @@ import 
org.apache.ignite.internal.testframework.BaseIgniteAbstractTest;
 import org.apache.ignite.internal.util.IgniteSpinBusyLock;
 import org.apache.ignite.network.ClusterNode;
 import org.apache.ignite.network.NetworkAddress;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 
 @ExtendWith(ConfigurationExtension.class)
 class MetaStorageLeaderElectionListenerTest extends BaseIgniteAbstractTest {
-    private static final String NODE_NAME = "foo";
+    private static final String NODE_NAME = 
"MetaStorageLeaderElectionListenerTest";
 
     @InjectConfiguration
     private SystemDistributedConfiguration systemConfiguration;
 
+    private ClusterTimeImpl clusterTime;
+
+    @AfterEach
+    void cleanup() throws Exception {
+        clusterTime.close();
+    }
+
     /**
      * If node lost leadership before Ignite is fully initialized, it could 
try to stop the safe time scheduler
      * before it was started. Scheduler should not be created in this case, 
until node regains leadership.
@@ -67,7 +75,7 @@ class MetaStorageLeaderElectionListenerTest extends 
BaseIgniteAbstractTest {
 
         IgniteSpinBusyLock busyLock = new IgniteSpinBusyLock();
 
-        ClusterTimeImpl clusterTime = spy(new ClusterTimeImpl(NODE_NAME, 
busyLock, new HybridClockImpl()));
+        clusterTime = spy(new ClusterTimeImpl(NODE_NAME, busyLock, new 
HybridClockImpl()));
 
         CompletableFuture<MetaStorageServiceImpl> metaStorageSvcFut = new 
CompletableFuture<>();
         CompletableFuture<SystemDistributedConfiguration> 
systemConfigurationFuture = completedFuture(systemConfiguration);
diff --git 
a/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/time/ClusterTimeTest.java
 
b/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/time/ClusterTimeTest.java
index 5b1ad3652e5..5fdb2bf0c0f 100644
--- 
a/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/time/ClusterTimeTest.java
+++ 
b/modules/metastorage/src/test/java/org/apache/ignite/internal/metastorage/server/time/ClusterTimeTest.java
@@ -54,7 +54,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
 public class ClusterTimeTest extends BaseIgniteAbstractTest {
     private final HybridClock clock = new HybridClockImpl();
 
-    private final ClusterTimeImpl clusterTime = new ClusterTimeImpl("foo", new 
IgniteSpinBusyLock(), clock);
+    private final ClusterTimeImpl clusterTime = new 
ClusterTimeImpl("ClusterTimeTest", new IgniteSpinBusyLock(), clock);
 
     @AfterEach
     void tearDown() {

Reply via email to