@@ -17,23 +17,27 @@ def _check_and_mark_infra(current_job, job_ids, push_ids):
17
17
# look for all jobs in pushids matching current_job.job_type.name
18
18
# if older are failing for "infra", then ensure same job is passing
19
19
# if so mark as intermittent
20
- extra_jobs = Job .objects .filter (
21
- push__id__range = (push_ids [- 1 ], push_ids [0 ]),
22
- repository__id = current_job .repository .id ,
23
- job_type__name = current_job .job_type .name ,
24
- failure_classification_id__in = [1 , 6 , 8 ],
25
- job_log__status__in = [1 , 3 ], # ignore pending, failed
26
- state = "completed" , # ignore running/pending
27
- result__in = [
28
- "busted" ,
29
- "testfailed" ,
30
- "exception" ,
31
- "success" ,
32
- ], # primarily ignore retry/usercancel
33
- ).values (
34
- "id" ,
35
- "result" ,
36
- "failure_classification_id" ,
20
+ extra_jobs = (
21
+ Job .objects .filter (
22
+ push__id__range = (push_ids [- 1 ], push_ids [0 ]),
23
+ repository__id = current_job .repository .id ,
24
+ job_type__name = current_job .job_type .name ,
25
+ failure_classification_id__in = [1 , 6 , 8 ],
26
+ job_log__status__in = [1 , 3 ], # ignore pending, failed
27
+ state = "completed" , # ignore running/pending
28
+ result__in = [
29
+ "busted" ,
30
+ "testfailed" ,
31
+ "exception" ,
32
+ "success" ,
33
+ ], # primarily ignore retry/usercancel
34
+ )
35
+ .values (
36
+ "id" ,
37
+ "result" ,
38
+ "failure_classification_id" ,
39
+ )
40
+ .distinct ("id" )
37
41
)
38
42
39
43
# ignore previous classified, we are looking for NEW extra jobs
@@ -116,6 +120,7 @@ def check_and_mark_intermittent(job_id):
116
120
], # primarily ignore retry/usercancel/unknown
117
121
group_result__status__in = [GroupStatus .OK , GroupStatus .ERROR ],
118
122
)
123
+ .exclude (name__exact = "" )
119
124
.values (
120
125
"name" ,
121
126
"job_logs__job__id" ,
0 commit comments