turbo_tests icon indicating copy to clipboard operation
turbo_tests copied to clipboard

Better handle interrupts

Open Bo98 opened this issue 2 years ago • 0 comments

Currently if you hit Ctrl+C, the underlying rspec tests might continue to still run. This behaviours seemed to consistently happen in my environment (executed via bundle exec).

This PR adopts logic similar to parallel_tests that fixes this: https://github.com/grosser/parallel_tests/blob/6e9be6f529b64e5f9c8e4439754bca0b2ef3f2b1/lib/parallel_tests/cli.rb#L31-L54

An extra consideration for turbo_tests was that the Ctrl+C might happen before the FIFO file was written to, causing the read thread to block indefinitely. A fix for this is to make the process exit monitoring thread write to the FIFO file (if not already written to) to signal the other thread to stop.

Bo98 avatar Dec 17 '23 02:12 Bo98