Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions benchmarks/error_tracking_simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,15 @@ def benchmark_simple_third_party(with_error: false)
puts "Current pid is #{Process.pid}"

def run_benchmark(&block)
# Forking to avoid monkey-patching leaking between benchmarks
pid = fork(&block)
_, status = Process.wait2(pid)

raise "Benchmark failed with status #{status}" unless status.success?
if VALIDATE_BENCHMARK_MODE
block.call
else
# Forking to avoid monkey-patching leaking between benchmarks
pid = fork(&block)
_, status = Process.wait2(pid)

raise "Benchmark failed with status #{status}" unless status.success?
end
end

ErrorTrackingSimpleBenchmark.new.instance_exec do
Expand Down
14 changes: 9 additions & 5 deletions benchmarks/tracing_trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,15 @@ def benchmark_propagation_trace_context
puts "Current pid is #{Process.pid}"

def run_benchmark(&block)
# Forking to avoid monkey-patching leaking between benchmarks
pid = fork { block.call }
_, status = Process.wait2(pid)

raise "Benchmark failed with status #{status}" unless status.success?
if VALIDATE_BENCHMARK_MODE
block.call
else
# Forking to avoid monkey-patching leaking between benchmarks
pid = fork { block.call }
_, status = Process.wait2(pid)

raise "Benchmark failed with status #{status}" unless status.success?
end
end

TracingTraceBenchmark.new.instance_exec do
Expand Down
Loading