Increase timeout

This commit is contained in:
alesapin 2019-02-05 13:15:14 +03:00
parent 2556a96e9e
commit edf0344d0e
2 changed files with 10 additions and 8 deletions

View File

@ -83,19 +83,20 @@ def test_reconnect(started_cluster):
with PartitionManager() as pm: with PartitionManager() as pm:
# Open a connection for insertion. # Open a connection for insertion.
instance.query("INSERT INTO distributed VALUES (1)") instance.query("INSERT INTO distributed VALUES (1)")
time.sleep(0.5) time.sleep(1)
assert remote.query("SELECT count(*) FROM local1").strip() == '1' assert remote.query("SELECT count(*) FROM local1").strip() == '1'
# Now break the connection. # Now break the connection.
pm.partition_instances(instance, remote, action='REJECT --reject-with tcp-reset') pm.partition_instances(instance, remote, action='REJECT --reject-with tcp-reset')
instance.query("INSERT INTO distributed VALUES (2)") instance.query("INSERT INTO distributed VALUES (2)")
time.sleep(0.5) time.sleep(1)
# Heal the partition and insert more data. # Heal the partition and insert more data.
# The connection must be reestablished and after some time all data must be inserted. # The connection must be reestablished and after some time all data must be inserted.
pm.heal_all() pm.heal_all()
time.sleep(1)
instance.query("INSERT INTO distributed VALUES (3)") instance.query("INSERT INTO distributed VALUES (3)")
time.sleep(0.5) time.sleep(1)
assert remote.query("SELECT count(*) FROM local1").strip() == '3' assert remote.query("SELECT count(*) FROM local1").strip() == '3'
@ -191,4 +192,3 @@ def test_inserts_low_cardinality(started_cluster):
instance.query("INSERT INTO low_cardinality_all (d,x,s) VALUES ('2018-11-12',1,'123')") instance.query("INSERT INTO low_cardinality_all (d,x,s) VALUES ('2018-11-12',1,'123')")
time.sleep(0.5) time.sleep(0.5)
assert instance.query("SELECT count(*) FROM low_cardinality_all").strip() == '1' assert instance.query("SELECT count(*) FROM low_cardinality_all").strip() == '1'

View File

@ -39,7 +39,7 @@ CREATE TABLE distributed (d Date, x UInt32) ENGINE = Distributed('test_cluster',
instance_test_inserts_batching.query("CREATE TABLE local2_source (d Date, x UInt32) ENGINE = Log") instance_test_inserts_batching.query("CREATE TABLE local2_source (d Date, x UInt32) ENGINE = Log")
instance_test_inserts_batching.query("CREATE MATERIALIZED VIEW local2_view to distributed AS SELECT d,x FROM local2_source") instance_test_inserts_batching.query("CREATE MATERIALIZED VIEW local2_view to distributed AS SELECT d,x FROM local2_source")
instance_test_inserts_local_cluster.query("CREATE TABLE local_source (d Date, x UInt32) ENGINE = Memory") instance_test_inserts_local_cluster.query("CREATE TABLE local_source (d Date, x UInt32) ENGINE = Memory")
instance_test_inserts_local_cluster.query("CREATE MATERIALIZED VIEW local_view to distributed_on_local AS SELECT d,x FROM local_source") instance_test_inserts_local_cluster.query("CREATE MATERIALIZED VIEW local_view to distributed_on_local AS SELECT d,x FROM local_source")
instance_test_inserts_local_cluster.query("CREATE TABLE local (d Date, x UInt32) ENGINE = MergeTree(d, x, 8192)") instance_test_inserts_local_cluster.query("CREATE TABLE local (d Date, x UInt32) ENGINE = MergeTree(d, x, 8192)")
@ -60,19 +60,21 @@ def test_reconnect(started_cluster):
with PartitionManager() as pm: with PartitionManager() as pm:
# Open a connection for insertion. # Open a connection for insertion.
instance.query("INSERT INTO local1_source VALUES (1)") instance.query("INSERT INTO local1_source VALUES (1)")
time.sleep(0.5) time.sleep(1)
assert remote.query("SELECT count(*) FROM local1").strip() == '1' assert remote.query("SELECT count(*) FROM local1").strip() == '1'
# Now break the connection. # Now break the connection.
pm.partition_instances(instance, remote, action='REJECT --reject-with tcp-reset') pm.partition_instances(instance, remote, action='REJECT --reject-with tcp-reset')
instance.query("INSERT INTO local1_source VALUES (2)") instance.query("INSERT INTO local1_source VALUES (2)")
time.sleep(0.5) time.sleep(1)
# Heal the partition and insert more data. # Heal the partition and insert more data.
# The connection must be reestablished and after some time all data must be inserted. # The connection must be reestablished and after some time all data must be inserted.
pm.heal_all() pm.heal_all()
time.sleep(1)
instance.query("INSERT INTO local1_source VALUES (3)") instance.query("INSERT INTO local1_source VALUES (3)")
time.sleep(0.5) time.sleep(1)
assert remote.query("SELECT count(*) FROM local1").strip() == '3' assert remote.query("SELECT count(*) FROM local1").strip() == '3'