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

ptupitsyn 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 ccea9b68d4 IGNITE-20576 Fix 
testGetReturningTupleWithUnknownSchemaRequestsNewSchema (#2738)
ccea9b68d4 is described below

commit ccea9b68d428aea245042f96bc4dd71480268ef3
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon Oct 23 13:27:16 2023 +0300

    IGNITE-20576 Fix testGetReturningTupleWithUnknownSchemaRequestsNewSchema 
(#2738)
---
 .../org/apache/ignite/client/ClientTableTest.java  | 26 +++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git 
a/modules/client/src/test/java/org/apache/ignite/client/ClientTableTest.java 
b/modules/client/src/test/java/org/apache/ignite/client/ClientTableTest.java
index 2d58f645f8..77a5ab7f48 100644
--- a/modules/client/src/test/java/org/apache/ignite/client/ClientTableTest.java
+++ b/modules/client/src/test/java/org/apache/ignite/client/ClientTableTest.java
@@ -41,7 +41,6 @@ import org.apache.ignite.lang.IgniteException;
 import org.apache.ignite.table.RecordView;
 import org.apache.ignite.table.Table;
 import org.apache.ignite.table.Tuple;
-import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 /**
@@ -111,27 +110,24 @@ public class ClientTableTest extends 
AbstractClientTableTest {
     }
 
     @Test
-    @Disabled("IGNITE-20576")
     public void testGetReturningTupleWithUnknownSchemaRequestsNewSchema() 
throws Exception {
-        FakeSchemaRegistry.setLastVer(2);
+        var embeddedView = defaultTable().recordView();
 
-        var table = defaultTable();
-        var recView = table.recordView();
-        Tuple tuple = tuple();
-        recView.upsert(null, tuple);
+        try (var client2 = startClient()) {
+            // Upsert from client, which will cache schema version 1.
+            FakeSchemaRegistry.setLastVer(1);
+            RecordView<Tuple> clientView = 
client2.tables().table(DEFAULT_TABLE).recordView();
+            clientView.upsert(null, tuple(-1L));
 
-        FakeSchemaRegistry.setLastVer(1);
+            // Upsert from server with schema version 2.
+            FakeSchemaRegistry.setLastVer(2);
+            embeddedView.upsert(null, tuple());
 
-        try (var client2 = startClient()) {
-            RecordView<Tuple> table2 = 
client2.tables().table(table.name()).recordView();
-            var resTuple = table2.get(null, tuple);
+            // Get from client, which should force schema update and retry.
+            var resTuple = clientView.get(null, defaultTupleKey());
 
-            assertEquals(2, tuple.columnCount());
             assertEquals(3, resTuple.columnCount());
-
-            assertEquals(-1, tuple.columnIndex("XYZ"));
             assertEquals(2, resTuple.columnIndex("XYZ"));
-
             assertEquals(DEFAULT_NAME, resTuple.stringValue("name"));
             assertEquals(DEFAULT_ID, resTuple.longValue("id"));
         }

Reply via email to