Skip to content

Commit cefd95b

Browse files
authored
Merge pull request rails#52917 from jhawthorn/prerecorded_option1
Call prerecord to fix verbose test runs under parallelization
2 parents 2ddf544 + 8b0ff4f commit cefd95b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

activesupport/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Print test names when running `rails test -v` for parallel tests.
2+
3+
*John Hawthorn*, *Abeid Ahmed*
4+
15
* Deprecate `Benchmark.ms` core extension.
26

37
The `benchmark` gem will become bundled in Ruby 3.5

activesupport/lib/active_support/testing/parallelization/server.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
module ActiveSupport
77
module Testing
88
class Parallelization # :nodoc:
9+
PrerecordResultClass = Struct.new(:name)
10+
911
class Server
1012
include DRb::DRbUndumped
1113

@@ -21,6 +23,7 @@ def record(reporter, result)
2123
@in_flight.delete([result.klass, result.name])
2224

2325
reporter.synchronize do
26+
reporter.prerecord(PrerecordResultClass.new(result.klass), result.name)
2427
reporter.record(result)
2528
end
2629
end

0 commit comments

Comments
 (0)