@@ -841,44 +841,34 @@ def test_archive_replica_not_null_offset(self):
841
841
self .backup_node (
842
842
backup_dir ,'node' ,replica ,replica .data_dir ,
843
843
options = [
844
- '--archive-timeout=30' ,
845
- '--log-level-console=LOG' ,
844
+ '--archive-timeout=10' ,
846
845
'--no-validate' ],
847
846
return_id = False )
848
847
849
- try :
848
+ with self . assertRaises ( ProbackupException ) as ctx :
850
849
self .backup_node (
851
850
backup_dir ,'node' ,replica ,replica .data_dir ,
852
851
options = [
853
- '--archive-timeout=30 ' ,
852
+ '--archive-timeout=10 ' ,
854
853
'--log-level-console=LOG' ,
855
854
'--no-validate' ])
856
- # we should die here because exception is what we expect to happen
857
- self .assertEqual (
858
- 1 ,0 ,
859
- "Expecting Error because of archive timeout. "
860
- "\n Output: {0}\n CMD: {1}" .format (
861
- repr (self .output ),self .cmd ))
862
- except ProbackupException as e :
863
- # vanilla -- 0/4000060
864
- # pgproee -- 0/4000078
865
- self .assertRegex (
866
- e .message ,
867
- r'LOG: Looking for LSN (0/4000060|0/4000078|0/4000070) in segment: 000000010000000000000004' ,
868
- "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
869
- repr (e .message ),self .cmd ))
870
-
871
- self .assertRegex (
872
- e .message ,
873
- r'INFO: Wait for LSN (0/4000060|0/4000078|0/4000070) in archived WAL segment' ,
874
- "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
875
- repr (e .message ),self .cmd ))
876
-
877
- self .assertIn (
878
- 'ERROR: WAL segment 000000010000000000000004 could not be archived in 30 seconds' ,
879
- e .message ,
880
- "\n Unexpected Error Message: {0}\n CMD: {1}" .format (
881
- repr (e .message ),self .cmd ))
855
+ e = ctx .exception
856
+ # vanilla -- 0/4000060
857
+ # pgproee -- 0/4000078
858
+ self .assertRegex (
859
+ e .message ,
860
+ r'LOG: Looking for LSN (0/4000060|0/4000078|0/4000070) in segment: 000000010000000000000004' ,
861
+ "\n CMD: {0}" .format (self .cmd ))
862
+
863
+ self .assertRegex (
864
+ e .message ,
865
+ r'INFO: Wait for LSN (0/4000060|0/4000078|0/4000070) in archived WAL segment' ,
866
+ "\n CMD: {0}" .format (self .cmd ))
867
+
868
+ self .assertRegex (
869
+ e .message ,
870
+ r'ERROR: WAL segment 000000010000000000000004 could not be archived in \d+ seconds' ,
871
+ "\n CMD: {0}" .format (self .cmd ))
882
872
883
873
# @unittest.skip("skip")
884
874
def test_replica_toast (self ):