From 04c8a02465e0467c48d1ef841959fc73652f1c51 Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Mon, 13 Mar 2023 23:33:11 +0200 Subject: [PATCH] relax allocation params --- tests/bwc/test_recovery.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/bwc/test_recovery.py b/tests/bwc/test_recovery.py index 63916098..35cef50e 100644 --- a/tests/bwc/test_recovery.py +++ b/tests/bwc/test_recovery.py @@ -252,8 +252,8 @@ def _test_recovery(self, path): with connect(cluster.node().http_url, error_trace=True) as conn: c = conn.cursor() c.execute(''' - create table doc.test(x int) clustered into 1 shards with( number_of_replicas = 1, - "unassigned.node_left.delayed_timeout" = '100ms', "allocation.max_retries" = '0') + create table doc.test(x int) clustered into 1 shards with(number_of_replicas = 1, + "unassigned.node_left.delayed_timeout" = '20s', "allocation.max_retries" = '10') ''') num_docs = random.randint(0, 10) @@ -290,8 +290,8 @@ def _test_recovery_closed_index(self, path): with connect(cluster.node().http_url, error_trace=True) as conn: c = conn.cursor() c.execute(''' - create table doc.test(x int) clustered into 1 shards with( number_of_replicas = 1, - "unassigned.node_left.delayed_timeout" = '100ms', "allocation.max_retries" = '0') + create table doc.test(x int) clustered into 1 shards with(number_of_replicas = 1, + "unassigned.node_left.delayed_timeout" = '20s', "allocation.max_retries" = '10') ''') assert_busy(lambda: self._assert_is_green(conn, 'doc', 'test')) @@ -323,7 +323,7 @@ def _test_closed_index_during_rolling_upgrade(self, path): with connect(cluster.node().http_url, error_trace=True) as conn: c = conn.cursor() c.execute(''' - create table doc.old_cluster(x int) clustered into 1 shards with( number_of_replicas = 0) + create table doc.old_cluster(x int) clustered into 1 shards with(number_of_replicas = 0) ''') self._assert_is_green(conn, 'doc', 'old_cluster') @@ -335,7 +335,7 @@ def _test_closed_index_during_rolling_upgrade(self, path): self._assert_is_closed(conn, 'doc', 'old_cluster') c.execute(''' - create table doc.mixed_cluster(x int) clustered into 1 shards with( number_of_replicas = 0) + create table doc.mixed_cluster(x int) clustered into 1 shards with(number_of_replicas = 0) ''') assert_busy(lambda: self._assert_is_green(conn, 'doc', 'mixed_cluster')) @@ -350,7 +350,7 @@ def _test_closed_index_during_rolling_upgrade(self, path): self._assert_is_closed(conn, 'doc', 'mixed_cluster') c.execute(''' - create table doc.upgraded_cluster(x int) clustered into 1 shards with( number_of_replicas = 0) + create table doc.upgraded_cluster(x int) clustered into 1 shards with(number_of_replicas = 0) ''') assert_busy(lambda: self._assert_is_green(conn, 'doc', 'upgraded_cluster')) @@ -373,7 +373,7 @@ def _test_update_docs(self, path): c = conn.cursor() c.execute(''' create table doc.test(id int primary key, data text) clustered into 1 shards with( - "unassigned.node_left.delayed_timeout" = '100ms', "number_of_replicas" = 2) + "unassigned.node_left.delayed_timeout" = '20s', "number_of_replicas" = 2) ''') inserts = [(i, str(random.randint)) for i in range(0, 100)] @@ -480,7 +480,7 @@ def _test_turnoff_translog_retention_after_upgraded(self, path): c = conn.cursor() number_of_replicas = random.randint(0, 2) c.execute(''' - create table doc.test(x int) clustered into 1 shards with( number_of_replicas =?, + create table doc.test(x int) clustered into 1 shards with(number_of_replicas =?, "soft_deletes.enabled" = true) ''', (number_of_replicas, )) @@ -536,7 +536,7 @@ def _test_auto_expand_indices_during_rolling_upgrade(self, path): node_ids = c.fetchall() self.assertEqual(len(node_ids), number_of_nodes) - c.execute('''create table doc.test(x int) clustered into 1 shards with( "number_of_replicas" = ?)''', + c.execute('''create table doc.test(x int) clustered into 1 shards with("number_of_replicas" = ?)''', (f"0-{number_of_replicas}",)) assert_busy(lambda: self._assert_is_green(conn, 'doc', 'test')) @@ -630,8 +630,8 @@ def _test_retention_leases_established_when_relocating_primary(self, path): '''create table doc.test(x int) clustered into ? shards with( "number_of_replicas" = ?, "soft_deletes.enabled" = false, - "allocation.max_retries" = 0, - "unassigned.node_left.delayed_timeout" = '100ms' + "allocation.max_retries" = 10, + "unassigned.node_left.delayed_timeout" = '20s' )''', (number_of_shards, number_of_replicas,))