From a63baa5db1eb6256b15f5018313ee245d0a6b45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A9=20Dupuis?= Date: Fri, 10 May 2024 18:52:01 -0700 Subject: [PATCH] Fix test runner --fail-fast test flake Without the sleep, the test has high variability in the amount of test ran before stopping. With the sleep, the test is pretty stable with negligeable impact on run time. --- railties/test/application/test_runner_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index f30bdb2890150..a1e587315aacc 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -782,8 +782,9 @@ def test_verify_fail_fast assert false end - 10.times do |n| + 4.times do |n| define_method("test_verify_fail_fast_\#{n}") do + sleep 0.1 assert true end end