@@ -101,6 +101,7 @@ async def test_kill_db_process(
101101 await are_writes_increasing (ops_test , primary_name )
102102
103103 # Verify that the database service got restarted and is ready in the old primary.
104+ logger .info (f"waiting for the database service to restart on { primary_name } " )
104105 assert await is_postgresql_ready (ops_test , primary_name )
105106
106107 # Verify that a new primary gets elected (ie old primary is secondary).
@@ -147,6 +148,7 @@ async def test_freeze_db_process(
147148 ops_test , primary_name , process , "SIGCONT" , use_ssh
148149 )
149150 # Verify that the database service got restarted and is ready in the old primary.
151+ logger .info (f"waiting for the database service to restart on { primary_name } " )
150152 assert await is_postgresql_ready (ops_test , primary_name )
151153
152154 await is_cluster_updated (ops_test , primary_name )
@@ -174,6 +176,7 @@ async def test_restart_db_process(
174176 await are_writes_increasing (ops_test , primary_name )
175177
176178 # Verify that the database service got restarted and is ready in the old primary.
179+ logger .info (f"waiting for the database service to restart on { primary_name } " )
177180 assert await is_postgresql_ready (ops_test , primary_name )
178181
179182 # Verify that a new primary gets elected (ie old primary is secondary).
@@ -288,6 +291,7 @@ async def test_forceful_restart_without_data_and_transaction_logs(
288291 sleep (MEDIAN_ELECTION_TIME * 2 )
289292
290293 async with ops_test .fast_forward ():
294+ logger .info ("checking whether writes are increasing" )
291295 await are_writes_increasing (ops_test , primary_name )
292296
293297 # Verify that a new primary gets elected (ie old primary is secondary).
@@ -305,6 +309,7 @@ async def test_forceful_restart_without_data_and_transaction_logs(
305309 await change_wal_settings (ops_test , unit .name , 32 , 32 , 1 )
306310
307311 # Rotate the WAL segments.
312+ logger .info (f"rotating WAL segments on { new_primary_name } " )
308313 files = await list_wal_files (ops_test , app )
309314 host = await get_unit_address (ops_test , new_primary_name )
310315 password = await get_password (ops_test , down_unit = primary_name )
@@ -317,17 +322,20 @@ async def test_forceful_restart_without_data_and_transaction_logs(
317322 cursor .execute ("SELECT pg_switch_wal();" )
318323 connection .close ()
319324 new_files = await list_wal_files (ops_test , app )
325+
320326 # Check that the WAL was correctly rotated.
327+
321328 for unit_name in files :
322329 assert not files [unit_name ].intersection (
323330 new_files
324- ), "WAL segments weren't correctly rotated"
331+ ), f "WAL segments weren't correctly rotated on { unit_name } "
325332
326333 # Start the systemd service in the old primary.
327334 logger .info (f"starting database on { primary_name } " )
328335 await run_command_on_unit (ops_test , primary_name , "/charm/bin/pebble start postgresql" )
329336
330337 # Verify that the database service got restarted and is ready in the old primary.
338+ logger .info (f"waiting for the database service to restart on { primary_name } " )
331339 assert await is_postgresql_ready (ops_test , primary_name )
332340
333341 await is_cluster_updated (ops_test , primary_name )
@@ -385,14 +393,14 @@ async def test_network_cut(
385393 remove_instance_isolation (ops_test )
386394
387395 # Verify that the database service got restarted and is ready in the old primary.
388- logger .info ("waiting for the database service to restart" )
396+ logger .info (f "waiting for the database service to restart on { primary_name } " )
389397 assert await is_postgresql_ready (ops_test , primary_name )
390398
391399 # Verify that connection is possible.
392400 logger .info ("checking whether the connectivity to the database is working" )
393401 assert await is_connection_possible (
394402 ops_test , primary_name
395- ), "Connection is not possible after network restore"
403+ ), f "Connection is not possible to { primary_name } after network restore"
396404
397405 await is_cluster_updated (ops_test , primary_name )
398406
0 commit comments