@@ -2872,10 +2872,6 @@ def test_issue_289(self):
2872
2872
backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
2873
2873
self .init_pb (backup_dir )
2874
2874
self .add_instance (backup_dir , 'node' , node )
2875
- # self.set_archiving(backup_dir, 'node', node)
2876
-
2877
- # os.rmdir(
2878
- # os.path.join(backup_dir, "wal", "node"))
2879
2875
2880
2876
node .slow_start ()
2881
2877
@@ -2905,7 +2901,54 @@ def test_issue_289(self):
2905
2901
self .assertEqual (
2906
2902
self .show_pb (backup_dir , 'node' )[0 ]['status' ], "ERROR" )
2907
2903
2908
- exit (1 )
2904
+ # Clean after yourself
2905
+ self .del_test_dir (module_name , fname )
2906
+
2907
+ # @unittest.skip("skip")
2908
+ def test_issue_290 (self ):
2909
+ """
2910
+ https://github.com/postgrespro/pg_probackup/issues/290
2911
+ """
2912
+ fname = self .id ().split ('.' )[3 ]
2913
+ node = self .make_simple_node (
2914
+ base_dir = os .path .join (module_name , fname , 'node' ),
2915
+ initdb_params = ['--data-checksums' ])
2916
+
2917
+ backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
2918
+ self .init_pb (backup_dir )
2919
+ self .add_instance (backup_dir , 'node' , node )
2920
+ self .set_archiving (backup_dir , 'node' , node )
2921
+
2922
+ os .rmdir (
2923
+ os .path .join (backup_dir , "wal" , "node" ))
2924
+
2925
+ node .slow_start ()
2926
+
2927
+ try :
2928
+ self .backup_node (
2929
+ backup_dir , 'node' , node ,
2930
+ options = ['--archive-timeout=10s' ])
2931
+ # we should die here because exception is what we expect to happen
2932
+ self .assertEqual (
2933
+ 1 , 0 ,
2934
+ "Expecting Error because full backup is missing"
2935
+ "\n Output: {0} \n CMD: {1}" .format (
2936
+ repr (self .output ), self .cmd ))
2937
+ except ProbackupException as e :
2938
+ self .assertNotIn (
2939
+ "INFO: Wait for WAL segment" ,
2940
+ e .message ,
2941
+ "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
2942
+ repr (e .message ), self .cmd ))
2943
+
2944
+ self .assertIn (
2945
+ "WAL archive directory is not accessible" ,
2946
+ e .message ,
2947
+ "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
2948
+ repr (e .message ), self .cmd ))
2949
+
2950
+ self .assertEqual (
2951
+ self .show_pb (backup_dir , 'node' )[0 ]['status' ], "ERROR" )
2909
2952
2910
2953
# Clean after yourself
2911
2954
self .del_test_dir (module_name , fname )
0 commit comments