fix an unrelated flaky test

This commit is contained in:
Alexander Tokmakov 2023-03-23 13:48:02 +01:00
parent 54314061ab
commit eeb5a4c241

View File

@ -49,14 +49,14 @@ def test_default_column():
"INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[2, 102, 104], [4, 104, 108]]
)
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 101, 102], [3, 103, 106]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[2, 102, 104], [4, 104, 108], [1, 101, 102], [3, 103, 106]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 101, 102], [2, 102, 104], [3, 103, 106], [4, 104, 108]]
)
# INSERT INTO TABLE dist (x, y)
@ -66,12 +66,12 @@ def test_default_column():
settings=settings,
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV([[2, 22, 24]])
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV([[2, 22, 24]])
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 11, 12], [3, 33, 36]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[2, 22, 24], [1, 11, 12], [3, 33, 36]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 11, 12], [2, 22, 24], [3, 33, 36]]
)
@ -96,14 +96,14 @@ def test_materialized_column_allow_insert_materialized():
"INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[2, 102, 104], [4, 104, 108]]
)
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 101, 102], [3, 103, 106]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[2, 102, 104], [4, 104, 108], [1, 101, 102], [3, 103, 106]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 101, 102], [2, 102, 104], [3, 103, 106], [4, 104, 108]]
)
# INSERT INTO TABLE dist (x, y)
@ -113,12 +113,12 @@ def test_materialized_column_allow_insert_materialized():
settings=settings,
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV([[2, 22, 24]])
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV([[2, 22, 24]])
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 11, 12], [3, 33, 36]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[2, 22, 24], [1, 11, 12], [3, 33, 36]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 11, 12], [2, 22, 24], [3, 33, 36]]
)
@ -143,14 +143,14 @@ def test_materialized_column_disallow_insert_materialized():
"INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[2, 202, -200], [4, 204, -200]]
)
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 201, -200], [3, 203, -200]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[2, 202, -200], [4, 204, -200], [1, 201, -200], [3, 203, -200]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 201, -200], [2, 202, -200], [3, 203, -200], [4, 204, -200]]
)
# INSERT INTO TABLE dist (x, y)
@ -183,12 +183,12 @@ def test_materialized_column_disallow_insert_materialized_different_shards():
"INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings
)
node1.query("SYSTEM FLUSH DISTRIBUTED dist")
assert node1.query("SELECT x, y, z FROM local") == TSV(
assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[1, 201, -200], [3, 203, -200]]
)
assert node2.query("SELECT x, y, z FROM local") == TSV(
assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV(
[[2, 202, -200], [4, 204, -200]]
)
assert node1.query("SELECT x, y, z FROM dist") == TSV(
[[1, 201, -200], [3, 203, -200], [2, 202, -200], [4, 204, -200]]
assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV(
[[1, 201, -200], [2, 202, -200], [3, 203, -200], [4, 204, -200]]
)