@@ -264,45 +264,20 @@ def test_retry_fails_when_test_run_is_expired
264264 assert_equal "The test run is too old and can't be retried" , output
265265 end
266266
267- def test_worker_history_retry_writes_recovery_manifest
268- Dir . mktmpdir do |directory |
269- manifest_path = File . join ( directory , 'recovery.json' )
270- run_worker_history_worker ( manifest_path , retry_count : 0 )
271-
272- first_manifest = JSON . parse ( File . read ( manifest_path ) )
273- assert_equal 0 , first_manifest [ 'retry_count' ]
274- refute first_manifest [ 'resumed_shared_queue' ]
275- assert first_manifest [ 'replay_completed' ]
276-
277- out , = run_worker_history_worker ( manifest_path , retry_count : 1 )
278-
279- assert_includes out , "Replaying this worker's reservation history."
280- retry_manifest = JSON . parse ( File . read ( manifest_path ) )
281- assert_equal 1 , retry_manifest [ 'schema_version' ]
282- assert_equal '1' , retry_manifest [ 'worker_id' ]
283- assert_equal 1 , retry_manifest [ 'retry_count' ]
284- refute retry_manifest [ 'resumed_shared_queue' ]
285- assert retry_manifest [ 'replay_completed' ]
286- end
267+ def test_worker_history_retry_replays_worker_reservations
268+ run_worker_history_worker ( retry_count : 0 )
269+ out , = run_worker_history_worker ( retry_count : 1 )
270+
271+ assert_predicate $?, :success?
272+ assert_includes out , "Replaying this worker's reservation history."
287273 end
288274
289- def test_worker_history_retry_removes_stale_manifest_when_history_is_missing
290- run_worker_history_worker ( nil , retry_count : 0 , build_id : 'missing-history' , worker_id : '1' )
291-
292- Dir . mktmpdir do |directory |
293- manifest_path = File . join ( directory , 'recovery.json' )
294- File . write ( manifest_path , '{"stale":true}' )
295- out , = run_worker_history_worker (
296- manifest_path ,
297- retry_count : 1 ,
298- build_id : 'missing-history' ,
299- worker_id : '2'
300- )
275+ def test_worker_history_retry_fails_when_history_is_missing
276+ run_worker_history_worker ( retry_count : 0 , build_id : 'missing-history' , worker_id : '1' )
277+ out , err = run_worker_history_worker ( retry_count : 1 , build_id : 'missing-history' , worker_id : '2' )
301278
302- refute_predicate $?, :success?
303- assert_includes out , 'Reservation history is missing for worker 2'
304- refute_path_exists manifest_path
305- end
279+ refute_predicate $?, :success?
280+ assert_includes out + err , 'Reservation history is missing for worker 2'
306281 end
307282
308283 def test_retry_report
@@ -829,7 +804,7 @@ def test_utf8_tests_and_marshal
829804
830805 private
831806
832- def run_worker_history_worker ( manifest_path , retry_count :, build_id : 'worker-history' , worker_id : '1' )
807+ def run_worker_history_worker ( retry_count :, build_id : 'worker-history' , worker_id : '1' )
833808 args = [
834809 @exe , 'run' ,
835810 '--queue' , @redis_url ,
@@ -839,7 +814,6 @@ def run_worker_history_worker(manifest_path, retry_count:, build_id: 'worker-his
839814 '--timeout' , '1' ,
840815 '--retry-mode' , 'worker-history'
841816 ]
842- args . push ( '--recovery-manifest' , manifest_path ) if manifest_path
843817 args . push ( '-Itest' , 'test/passing_test.rb' )
844818
845819 capture_subprocess_io do
0 commit comments