Skip to content

Commit

Permalink
relax allocation params
Browse files Browse the repository at this point in the history
  • Loading branch information
matriv committed Mar 14, 2023
1 parent 9b00fa9 commit 04c8a02
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/bwc/test_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'))
Expand Down Expand Up @@ -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')
Expand All @@ -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'))
Expand All @@ -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'))
Expand All @@ -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)]
Expand Down Expand Up @@ -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, ))

Expand Down Expand Up @@ -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'))

Expand Down Expand Up @@ -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,))

Expand Down

0 comments on commit 04c8a02

Please sign in to comment.