Files
ubicloud/spec/lib/thread_printer_spec.rb
Daniel Farina 0e1b8759a9 Make thread printer test robust to multithreading
I saw a case of non-deterministic failure in CI that's almost
certainly caused by multiple threads being present when the thread
printer runs.  In particular, a thread with `puma` in the stack was
present.

Although the test suite is single-threaded, nothing synchronizes the
joining of all threads between tests.  While perhaps chasing such
non-determinism could be fruitful, doing so via the ThreadPrinter test
doesn't make sense; it'd have to be in a before/after/around
arrangement, e.g. in dispatcher_spec.rb:

    describe "#start_cohort" do
      after do
        Thread.list.each { _1.join if _1 != Thread.current }
      end
2025-03-06 09:28:05 -08:00

1.2 KiB