Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-20576 Fix testGetReturningTupleWithUnknownSchemaRequestsNewSchema #2738

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
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;

/**
Expand Down Expand Up @@ -111,27 +110,24 @@ public void testUpsertGetAsync() {
}

@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"));
}
Expand Down