You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ap...@apache.org on 2023/11/09 10:38:43 UTC

(ignite-3) branch main updated: IGNITE-20820 Increase await timeout in ItMetaStorageMultipleNodesAbstractTest (#2824)

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

apolovtsev 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 2b1665c68f IGNITE-20820 Increase await timeout in ItMetaStorageMultipleNodesAbstractTest (#2824)
2b1665c68f is described below

commit 2b1665c68f4a63a29cce7acb9491977735375a1c
Author: Alexander Polovtcev <al...@gmail.com>
AuthorDate: Thu Nov 9 12:38:38 2023 +0200

    IGNITE-20820 Increase await timeout in ItMetaStorageMultipleNodesAbstractTest (#2824)
---
 .../ItMetaStorageMultipleNodesAbstractTest.java    | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageMultipleNodesAbstractTest.java b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageMultipleNodesAbstractTest.java
index 0a292395f8..864a084638 100644
--- a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageMultipleNodesAbstractTest.java
+++ b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageMultipleNodesAbstractTest.java
@@ -97,6 +97,8 @@ import org.junit.jupiter.params.provider.ValueSource;
  */
 @ExtendWith(ConfigurationExtension.class)
 public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstractTest {
+    private static final long AWAIT_TIMEOUT = TimeUnit.SECONDS.toMillis(10);
+
     @InjectConfiguration
     private static RaftConfiguration raftConfiguration;
 
@@ -263,7 +265,7 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
 
     @AfterEach
     void tearDown() throws Exception {
-        IgniteUtils.closeAll(nodes.stream().map(node -> node::stop));
+        IgniteUtils.closeAll(nodes.parallelStream().map(node -> node::stop));
     }
 
     /**
@@ -346,14 +348,14 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
         assertThat(secondNode.metaStorageManager.get(new ByteArray("test")).thenApply(Entry::value), willBe(nullValue()));
 
         // Check that the second node has been registered as a learner.
-        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().equals(Set.of(secondNode.name())), 10_000));
+        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().equals(Set.of(secondNode.name())), AWAIT_TIMEOUT));
 
         // Stop the second node.
         secondNode.stop();
 
         nodes.remove(1);
 
-        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().isEmpty(), 10_000));
+        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().isEmpty(), AWAIT_TIMEOUT));
     }
 
     /**
@@ -381,14 +383,14 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
         assertThat(secondNode.metaStorageManager.get(new ByteArray("test")).thenApply(Entry::value), willBe(nullValue()));
 
         // Check that the second node has been registered as a learner.
-        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().equals(Set.of(secondNode.name())), 10_000));
+        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().equals(Set.of(secondNode.name())), AWAIT_TIMEOUT));
 
         // Stop the second node.
         secondNode.stop();
 
         nodes.remove(1);
 
-        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().isEmpty(), 10_000));
+        assertTrue(waitForCondition(() -> firstNode.getMetaStorageLearners().join().isEmpty(), AWAIT_TIMEOUT));
     }
 
     /**
@@ -447,12 +449,10 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
         );
 
         // Ensure watch listener is called.
-        assertTrue(watchCalledLatch.await(1, TimeUnit.SECONDS));
+        assertTrue(watchCalledLatch.await(AWAIT_TIMEOUT, TimeUnit.MILLISECONDS));
 
         // Wait until leader's safe time is propagated.
-        assertTrue(waitForCondition(() -> {
-            return firstNodeTime.currentSafeTime().compareTo(timeBeforeOp) > 0;
-        }, TimeUnit.SECONDS.toMillis(1)));
+        assertTrue(waitForCondition(() -> firstNodeTime.currentSafeTime().compareTo(timeBeforeOp) > 0, AWAIT_TIMEOUT));
 
         // Safe time must not be propagated to the second node at this moment.
         assertThat(firstNodeTime.currentSafeTime(), greaterThan(secondNodeTime.currentSafeTime()));
@@ -466,7 +466,7 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
             HybridTimestamp sf2 = secondNodeTime.currentSafeTime();
 
             return sf1.equals(sf2);
-        }, TimeUnit.SECONDS.toMillis(1)));
+        }, AWAIT_TIMEOUT));
 
         assertThat(
                 secondNode.metaStorageManager.put(ByteArray.fromString("test-key-2"), new byte[]{0, 1, 2, 3}),
@@ -478,7 +478,7 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
             HybridTimestamp sf2 = secondNodeTime.currentSafeTime();
 
             return sf1.equals(sf2);
-        }, TimeUnit.SECONDS.toMillis(1)));
+        }, AWAIT_TIMEOUT));
     }
 
     /**
@@ -511,7 +511,7 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
             HybridTimestamp sf2 = secondNodeTime.currentSafeTime();
 
             return sf1.equals(sf2);
-        }, TimeUnit.SECONDS.toMillis(1)));
+        }, AWAIT_TIMEOUT));
 
         // Change leader and check if propagation still works.
         Node prevLeader = transferLeadership(firstNode, secondNode);
@@ -526,7 +526,7 @@ public abstract class ItMetaStorageMultipleNodesAbstractTest extends IgniteAbstr
             HybridTimestamp sf2 = secondNodeTime.currentSafeTime();
 
             return sf1.equals(sf2);
-        }, TimeUnit.SECONDS.toMillis(1)));
+        }, AWAIT_TIMEOUT));
     }
 
     /**