Skip to content

Commit

Permalink
tests/migrations: make logging more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtanov committed Sep 16, 2024
1 parent a273fc7 commit 3558630
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tests/rptest/tests/data_migrations_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def migration_in_one_of_states():
return self.on_all_live_nodes(
id, lambda m: m is not None and m["state"] in states)

self.logger.info(f'waiting for {" or ".join(states)}')
wait_until(
migration_in_one_of_states,
timeout_sec=90,
Expand Down Expand Up @@ -238,21 +239,16 @@ def test_creating_and_listing_migrations(self):

admin.execute_data_migration_action(out_migration_id,
MigrationAction.prepare)
self.logger.info('waiting for preparing or prepared')
self.wait_for_migration_states(out_migration_id,
['preparing', 'prepared'])
self.logger.info('waiting for prepared')
self.wait_for_migration_states(out_migration_id, ['prepared'])
admin.execute_data_migration_action(out_migration_id,
MigrationAction.execute)
self.logger.info('waiting for executing or executed')
self.wait_for_migration_states(out_migration_id,
['executing', 'executed'])
self.logger.info('waiting for executed')
self.wait_for_migration_states(out_migration_id, ['executed'])
admin.execute_data_migration_action(out_migration_id,
MigrationAction.finish)
self.logger.info('waiting for cut_over or finished')
self.wait_for_migration_states(out_migration_id,
['cut_over', 'finished'])
self.wait_for_migration_states(out_migration_id, ['finished'])
Expand Down Expand Up @@ -287,21 +283,16 @@ def test_creating_and_listing_migrations(self):

admin.execute_data_migration_action(in_migration_id,
MigrationAction.prepare)
self.logger.info('waiting for preparing or prepared')
self.wait_for_migration_states(in_migration_id,
['preparing', 'prepared'])
self.logger.info('waiting for prepared')
self.wait_for_migration_states(in_migration_id, ['prepared'])
admin.execute_data_migration_action(in_migration_id,
MigrationAction.execute)
self.logger.info('waiting for executing or executed')
self.wait_for_migration_states(in_migration_id,
['executing', 'executed'])
self.logger.info('waiting for executed')
self.wait_for_migration_states(in_migration_id, ['executed'])
admin.execute_data_migration_action(in_migration_id,
MigrationAction.finish)
self.logger.info('waiting for cut_over or finished')
self.wait_for_migration_states(in_migration_id,
['cut_over', 'finished'])
self.wait_for_migration_states(in_migration_id, ['finished'])
Expand Down Expand Up @@ -506,7 +497,6 @@ def cancel(self, migration_id, topic_name):
admin = Admin(self.redpanda)
admin.execute_data_migration_action(migration_id,
MigrationAction.cancel)
self.logger.info('waiting for cancelled')
self.wait_for_migration_states(migration_id, ['cancelled'])
admin.delete_data_migration(migration_id)

Expand Down Expand Up @@ -718,7 +708,6 @@ def test_migrated_topic_data_integrity(self, transfer_leadership: bool,
admin.execute_data_migration_action(in_migration_id,
MigrationAction.finish)

self.logger.info('waiting for finished')
self.wait_for_migration_states(in_migration_id, ['finished'])
admin.delete_data_migration(in_migration_id)
# now the topic should be fully operational
Expand Down

0 comments on commit 3558630

Please sign in to comment.