From ae5555e43257141421e1637c259fbdae0a6ba479 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Thu, 1 Aug 2024 10:30:01 -0700 Subject: [PATCH] Watcher: Defer FS listener restart to fix Ruby 3.4.0.dev crash (#39) --- lib/mighty_test/watcher.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mighty_test/watcher.rb b/lib/mighty_test/watcher.rb index bbd0c8a..5432c5f 100644 --- a/lib/mighty_test/watcher.rb +++ b/lib/mighty_test/watcher.rb @@ -109,7 +109,8 @@ def mt(*test_paths, flags: []) $stdout.flush rescue Interrupt # Pressing ctrl-c kills the fs_event background process, so we have to manually restart it. - restart_file_system_listener + # Do this in a separate thread to work around odd behavior on Ruby 3.4. + Thread.new { restart_file_system_listener } end def start_file_system_listener