Skip to content

Commit c7bca9f

Browse files
committed
Add env variable into suite bin packing
1 parent f133a0c commit c7bca9f

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

ruby/lib/ci/queue/strategy/suite_bin_packing.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def initialize(config, redis: nil)
2929
{}
3030
end
3131
# Enforce the max chunk duration falls within this range.
32-
@minimum_max_duration = config&.suite_max_duration || 120_000
33-
@maximum_max_duration = config&.suite_max_duration || 300_000
32+
@minimum_max_duration = config&.suite_minimum_max_chunk_duration || 120_000
33+
@maximum_max_duration = config&.suite_maximum_max_chunk_duration || 300_000
3434
@fallback_duration = config&.timing_fallback_duration || 100.0
3535
@buffer_percent = config&.suite_buffer_percent || 10
3636

ruby/lib/minitest/queue/runner.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,24 @@ def parser
512512
queue_config.max_duration = max
513513
end
514514

515+
help = <<~EOS
516+
Defines a lower-bound for the max chunk duration in seconds.
517+
Defaults to 120 seconds.
518+
EOS
519+
opts.separator ""
520+
opts.on('--minimum-max-chunk-duration MILLISECONDS', Integer, help) do |min|
521+
queue_config.minimum_max_chunk_duration = min
522+
end
523+
524+
help = <<~EOS
525+
Defines an upper-bound for the max chunk duration in seconds.
526+
Defaults to 300 seconds.
527+
EOS
528+
opts.separator ""
529+
opts.on('--maximum-max-chunk-duration MILLISECONDS', Integer, help) do |max|
530+
queue_config.maximum_max_chunk_duration = max
531+
end
532+
515533
help = <<~EOS
516534
Defines how many user test tests can be fail.
517535
Defaults to none.

0 commit comments

Comments
 (0)