From 2b965d32a1ec1c77bf46e0914ee97fac7078126d Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Sat, 28 Feb 2026 02:14:16 +0100 Subject: [PATCH] Ruby: Don't run tests with forking threads by default --- bin/test_debug | 2 +- test/test_helper.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/test_debug b/bin/test_debug index 5e3147acb..f1dda8166 100755 --- a/bin/test_debug +++ b/bin/test_debug @@ -4,6 +4,6 @@ set -e # Exit on error make all ./run_herb_tests -NO_TIMEOUT=true bundle exec rake test +FORK_TESTS=true bundle exec rake test echo "Tests successful!" diff --git a/test/test_helper.rb b/test/test_helper.rb index 709515114..5d6dbfbb4 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,7 +9,11 @@ require "active_support/core_ext/string/output_safety" -require_relative "fork_helper" if ENV["NO_TIMEOUT"].nil? +if ENV["FORK_TESTS"] + require_relative "fork_helper" +else + puts "TIP: If a segfault in the native C extension crashes the test runner, run with FORK_TESTS=true to isolate each test in a forked process and identify which test causes the crash." +end require_relative "snapshot_utils" Minitest::Spec::DSL.send(:alias_method, :test, :it)