Skip to content

Commit

Permalink
Wait until created tables become visible in Cassandra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jan 23, 2023
1 parent bae0272 commit 962d4b5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,9 @@ public void testUserDefinedTypeInArray()
session.execute("CREATE TYPE tpch." + userDefinedTypeName + "(udt_field bigint)");
session.execute("CREATE TABLE tpch." + tableName + "(id bigint, col list<frozen<tpch." + userDefinedTypeName + ">>, primary key (id))");
session.execute("INSERT INTO tpch." + tableName + "(id, col) values (1, [{udt_field: 10}])");
assertContainsEventually(() -> execute("SHOW TABLES FROM cassandra.tpch"), resultBuilder(getSession(), VARCHAR)
.row(tableName)
.build(), new Duration(1, MINUTES));

assertQuery("SELECT * FROM " + tableName, "VALUES (1, '[\"{udt_field:10}\"]')");

Expand All @@ -1019,6 +1022,9 @@ public void testUserDefinedTypeInMap()
session.execute("CREATE TYPE tpch." + userDefinedTypeName + "(udt_field bigint)");
session.execute("CREATE TABLE tpch." + tableName + "(id bigint, col map<frozen<tpch." + userDefinedTypeName + ">, frozen<tpch." + userDefinedTypeName + ">>, primary key (id))");
session.execute("INSERT INTO tpch." + tableName + "(id, col) values (1, {{udt_field: 10}: {udt_field: -10}})");
assertContainsEventually(() -> execute("SHOW TABLES FROM cassandra.tpch"), resultBuilder(getSession(), VARCHAR)
.row(tableName)
.build(), new Duration(1, MINUTES));

assertQuery("SELECT * FROM " + tableName, "VALUES (1, '{\"{udt_field:10}\":\"{udt_field:-10}\"}')");

Expand All @@ -1035,6 +1041,9 @@ public void testUserDefinedTypeInSet()
session.execute("CREATE TYPE tpch." + userDefinedTypeName + "(udt_field bigint)");
session.execute("CREATE TABLE tpch." + tableName + "(id bigint, col set<frozen<tpch." + userDefinedTypeName + ">>, primary key (id))");
session.execute("INSERT INTO tpch." + tableName + "(id, col) values (1, {{udt_field: 10}})");
assertContainsEventually(() -> execute("SHOW TABLES FROM cassandra.tpch"), resultBuilder(getSession(), VARCHAR)
.row(tableName)
.build(), new Duration(1, MINUTES));

assertQuery("SELECT * FROM " + tableName, "VALUES (1, '[\"{udt_field:10}\"]')");

Expand Down

0 comments on commit 962d4b5

Please sign in to comment.