@@ -106,6 +106,38 @@ def test_multiple_issues(tracker, scotty, beam, server_config, long_term_beam):
106106 scotty .check_beam_state (long_term_beam , False )
107107
108108
109+ def test_faulty_tracker (tracker , scotty , beam , issue , server_config , faulty_tracker , local_beam_dir ):
110+ vacuum_threshold = server_config ['VACUUM_THRESHOLD' ]
111+
112+ beam = scotty .get_beam (scotty .beam_up (local_beam_dir ))
113+
114+ beam_with_issue = scotty .get_beam (scotty .beam_up (local_beam_dir ))
115+ beam_with_issue .set_issue_association (issue .id_in_scotty , True )
116+ beam_with_issue .update ()
117+
118+ faulty_issue = scotty .create_issue (faulty_tracker , '1' )
119+ beam_with_faulty_issue = scotty .get_beam (scotty .beam_up (local_beam_dir ))
120+ beam_with_faulty_issue .set_issue_association (faulty_issue , True )
121+ beam_with_faulty_issue .update ()
122+
123+ assert beam_with_issue .purge_time is None
124+ assert beam_with_faulty_issue .purge_time is None
125+ assert beam .purge_time is vacuum_threshold
126+ scotty .sleep (_DAY * vacuum_threshold )
127+
128+ for beam in [beam_with_faulty_issue , beam_with_faulty_issue , beam ]:
129+ beam .update ()
130+
131+ scotty .check_beam_state (beam , True )
132+ scotty .check_beam_state (beam_with_faulty_issue , False )
133+ scotty .check_beam_state (beam_with_issue , False )
134+
135+ issue .set_state (False )
136+ scotty .sleep (_DAY )
137+ beam_with_issue .update ()
138+ scotty .check_beam_state (beam_with_issue , True )
139+
140+
109141def test_multiple_issues_and_multiple_beams (local_beam_dir , tracker , scotty , server_config , long_term_beam ):
110142 vacuum_threshold = server_config ['VACUUM_THRESHOLD' ]
111143 beam1 = scotty .get_beam (scotty .beam_up (local_beam_dir ))
0 commit comments