@@ -80,13 +80,14 @@ fn sort_benchmark_requests(done: &HashSet<String>, request_queue: &mut [Benchmar
80
80
let level = & mut request_queue[ finished..] [ ..level_len] ;
81
81
level. sort_unstable_by_key ( |bmr| {
82
82
(
83
+ // Pr number takes priority
84
+ * bmr. pr ( ) . unwrap_or ( & 0 ) ,
83
85
// Order master commits before try commits
84
86
match bmr. commit_type {
85
87
BenchmarkRequestType :: Try { .. } => 1 ,
86
88
BenchmarkRequestType :: Master { .. } => 0 ,
87
89
BenchmarkRequestType :: Release { .. } => unreachable ! ( ) ,
88
90
} ,
89
- * bmr. pr ( ) . unwrap_or ( & 0 ) ,
90
91
bmr. created_at ,
91
92
)
92
93
} ) ;
@@ -534,15 +535,15 @@ mod tests {
534
535
* | m "rrr" C | -----+-->
535
536
* +-----------+ |
536
537
* | +---------------+
537
- * +--->| t "yee" R pr1 | 6 : a try with a low pr
538
+ * +--->| t "yee" R pr1 | 3 : a try with a low pr
538
539
* +---------------+
539
540
* +-----------+
540
541
* | m "aaa" C |
541
542
* +-----------+
542
543
* |
543
544
* V
544
545
* +----------------+
545
- * | m "mmm" R pr88 | 4 : a master commit
546
+ * | m "mmm" R pr88 | 6 : a master commit
546
547
* +----------------+
547
548
*
548
549
* +-----------+
@@ -551,7 +552,7 @@ mod tests {
551
552
* |
552
553
* V
553
554
* +----------------+
554
- * | m "123" R pr11 | 3 : a master commit
555
+ * | m "123" R pr11 | 4 : a master commit, high pr number
555
556
* +----------------+
556
557
*
557
558
*
@@ -561,12 +562,12 @@ mod tests {
561
562
* |
562
563
* V
563
564
* +----------------+
564
- * | m "foo" R pr77 | 4 : a master commit
565
+ * | m "foo" R pr77 | 5 : a master commit
565
566
* +----------------+
566
567
* |
567
568
* V
568
569
* +---------------+
569
- * | t "baz" R pr4 | 7: a try with a higher pr
570
+ * | t "baz" R pr4 | 7: a try with a low pr, blocked by parent
570
571
* +---------------+
571
572
*
572
573
* The master commits should take priority, then "yee" followed
@@ -597,7 +598,7 @@ mod tests {
597
598
598
599
queue_order_matches (
599
600
& sorted,
600
- & [ "t1" , "v.1.2.3" , "123 " , "foo " , "mmm " , "yee " , "baz" ] ,
601
+ & [ "t1" , "v.1.2.3" , "yee " , "123 " , "foo " , "mmm " , "baz" ] ,
601
602
) ;
602
603
Ok ( ctx)
603
604
} )
0 commit comments