@@ -1898,7 +1898,7 @@ def test_archive_push_sanity(self):
18981898self .backup_node (backup_dir ,'node' ,node )
18991899
19001900with open (os .path .join (node .logs_dir ,'postgresql.log' ),'r' )as f :
1901- postgres_log_content = f .read ()
1901+ postgres_log_content = cleanup_ptrack ( f .read () )
19021902
19031903# print(postgres_log_content)
19041904# make sure that .backup file is not compressed
@@ -1927,14 +1927,7 @@ def test_archive_push_sanity(self):
19271927replica .pgbench_init (scale = 10 )
19281928
19291929with open (os .path .join (replica .logs_dir ,'postgresql.log' ),'r' )as f :
1930- replica_log_content = f .read ()
1931-
1932- # PBCKP-423 - need to clean ptrack warning
1933- ptrack_is_not = 'Ptrack 1.X is not supported anymore'
1934- if ptrack_is_not in replica_log_content :
1935- lines = [line for line in replica_log_content .splitlines ()
1936- if ptrack_is_not not in line ]
1937- replica_log_content = "" .join (lines )
1930+ replica_log_content = cleanup_ptrack (f .read ())
19381931
19391932# make sure that .partial file is not compressed
19401933self .assertNotIn ('.partial.gz' ,replica_log_content )
@@ -2519,6 +2512,15 @@ def test_archive_empty_history_file(self):
25192512'WARNING: History file is corrupted or missing: "{0}"' .format (os .path .join (wal_dir ,'00000004.history' )),
25202513log_content )
25212514
2515+ def cleanup_ptrack (log_content ):
2516+ # PBCKP-423 - need to clean ptrack warning
2517+ ptrack_is_not = 'Ptrack 1.X is not supported anymore'
2518+ if ptrack_is_not in log_content :
2519+ lines = [line for line in log_content .splitlines ()
2520+ if ptrack_is_not not in line ]
2521+ log_content = "" .join (lines )
2522+ return log_content
2523+
25222524# TODO test with multiple not archived segments.
25232525# TODO corrupted file in archive.
25242526