Skip to content

Commit 90754a2

Browse files
committed
minor cleanup
1 parent f080cad commit 90754a2

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

tests/bwc/test_recovery.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test(self):
2929
self._test_closed_index_during_rolling_upgrade,
3030
self._test_closed_index_noop_recovery,
3131
self._test_relocation_with_concurrent_indexing,
32-
# self._test_auto_expand_indices_during_rolling_upgrade,
32+
# self._test_auto_expand_indices_during_rolling_upgrade
3333
]
3434
)
3535

@@ -39,9 +39,9 @@ def test_from_4_3(self):
3939
UpgradePath('4.3.x', 'latest-nightly')
4040
],
4141
[
42-
# self._test_retention_leases_established_when_promoting_primary,
4342
self._test_turnoff_translog_retention_after_upgraded,
4443
self._test_operation_based_recovery
44+
# self._test_retention_leases_established_when_promoting_primary
4545
]
4646
)
4747

@@ -552,15 +552,18 @@ def _test_turnoff_translog_retention_after_upgraded(self, path, nodes):
552552
time.sleep(3)
553553
self._assert_is_green(conn, 'doc', 'test')
554554
c.execute('refresh table doc.test')
555+
self._assert_translog_is_empty(conn, 'doc', 'test')
556+
557+
def _assert_translog_is_empty(self, conn, schema, table_name):
558+
c = conn.cursor()
559+
c.execute('''select translog_stats['number_of_operations'], translog_stats['uncommitted_operations']
560+
from sys.shards where table_name=? and schema_name=? ''', (table_name, schema))
561+
res = c.fetchall()
562+
self.assertTrue(res)
563+
for r in res:
564+
self.assertEqual(r[0], 0)
565+
self.assertEqual(r[1], 0)
555566

556-
# check for the shard on each node that the translog is empty
557-
c.execute('''select translog_stats['number_of_operations'], translog_stats['uncommitted_operations']
558-
from sys.shards where table_name='test' ''')
559-
res = c.fetchall()
560-
self.assertTrue(len(res), 3)
561-
for r in res:
562-
self.assertEqual(r[0], 0)
563-
self.assertEqual(r[1], 0)
564567

565568
def _test_retention_leases_established_when_promoting_primary(self, path, nodes):
566569
number_of_replicas = random.randint(1, 2)

0 commit comments

Comments
 (0)