Skip to content

Commit dc1e493

Browse files
committed
Fix {flame,ice}graph for minitest and test-unit
1 parent 8ea2cf8 commit dc1e493

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/qa/runner-assets/ruby/minitest.rb

+3
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def report
133133
aggregate.default = [] # dumb. group_by should provide this
134134

135135
corrected_time = ::Qa::Time.now_f - @suite_start_time
136+
137+
@trace.emit_final_stats
138+
136139
emit(
137140
'type' => 'final',
138141
'time' => corrected_time,

src/qa/runner-assets/ruby/shared.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,6 @@ def main(args)
11831183
trace_events = []
11841184
qa_trace = ::Qa::Trace.new(Process.pid) { |e| trace_events.push(e) }
11851185
trace_probes.each { |trace_probe| qa_trace.define_tracer(trace_probe) }
1186-
qa_trace.start
11871186

11881187
socket = ::Qa::ClientSocket.connect(args.shift)
11891188

@@ -1193,6 +1192,11 @@ def main(args)
11931192
worker_envs, initial_files = initial_config['workerEnvs'], initial_config['files']
11941193
passthrough = initial_config['passthrough']
11951194

1195+
if passthrough['sampleStack']
1196+
Qa::Trace.enable_stackprof!
1197+
end
1198+
qa_trace.start
1199+
11961200
# Delegate prefork actions.
11971201
@prefork.call(initial_files)
11981202

@@ -1230,10 +1234,6 @@ def main(args)
12301234
Qa::Stdcom.disable!
12311235
end
12321236

1233-
if passthrough['sampleStack']
1234-
Qa::Trace.enable_stackprof!
1235-
end
1236-
12371237
case passthrough['errorsCaptureLocals'].to_s
12381238
when 'true'
12391239
TracePoint.new(:raise) do |tp|

src/qa/runner-assets/ruby/test-unit.rb

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def tapout_before_suite(result)
4747
end
4848

4949
def tapout_after_suite(elapsed_time)
50+
@trace.emit_final_stats
51+
5052
emit(
5153
'type' => 'final',
5254
'time' => elapsed_time,

0 commit comments

Comments
 (0)