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

sergeychugunov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 7aca244b68d IGNITE-17317 Test implementation fixed to avoid race 
resulting in flaky test - Fixes #10151.
7aca244b68d is described below

commit 7aca244b68d81fa1f891d8f767be2a53b29438a3
Author: Sergey Chugunov <sergey.chugu...@gmail.com>
AuthorDate: Thu Jul 14 13:51:02 2022 +0300

    IGNITE-17317 Test implementation fixed to avoid race resulting in flaky 
test - Fixes #10151.
    
    Signed-off-by: Sergey Chugunov <sergey.chugu...@gmail.com>
---
 .../IgnitePdsBinaryMetadataAsyncWritingTest.java       | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
index 9b279be35f9..c1d5f9e958c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsBinaryMetadataAsyncWritingTest.java
@@ -58,6 +58,7 @@ import org.junit.Test;
 
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
 import static 
org.apache.ignite.cache.CacheWriteSynchronizationMode.PRIMARY_SYNC;
+import static org.apache.ignite.cluster.ClusterState.ACTIVE;
 import static org.apache.ignite.testframework.GridTestUtils.suppressException;
 
 /**
@@ -248,13 +249,22 @@ public class IgnitePdsBinaryMetadataAsyncWritingTest 
extends GridCommonAbstractT
 
         IgniteEx ig1 = startGrid(1);
 
-        ig0.cluster().active(true);
-
-        int ig1Key = findAffinityKeyForNode(ig0.affinity(DEFAULT_CACHE_NAME), 
ig1.localNode());
+        ig0.cluster().state(ACTIVE);
 
         IgniteCache<Object, Object> cache = ig0.cache(DEFAULT_CACHE_NAME);
 
-        cache.put(ig1Key, new TestAddress(0, "USA", "NYC", "6th Ave"));
+        try {
+            ig1.binary().builder(TestAddress.class.getName())
+                .setField("id", 0)
+                .setField("country", "USA")
+                .setField("city", "NYC")
+                .setField("street", "6th Ave")
+                .build();
+        }
+        catch (Exception ignored) {
+            // Creating binary object will fail as underlying storage for 
binary meta files is broken.
+            // We expect the node that has caught that error to be stopped by 
failure handler.
+        }
 
         waitForTopology(1);
     }

Reply via email to