serpapi / turbo_tests

Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
https://rubygems.org/gems/turbo_tests
MIT License
173 stars 25 forks source link

turbo_tests is not working with Windows #38

Closed hsbt closed 4 months ago

hsbt commented 1 year ago

see https://github.com/rubygems/rubygems/actions/runs/5286199021/jobs/9568614121?pr=6739#step:8:27

#<Thread:0x0000026a04cdca10 C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:174 run> terminated with exception (report_on_exception is true):
C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `initialize': No such file or directory @ rb_sysopen - tmp/test-pipes/subprocess-1 (Errno::ENOENT)
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `open'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `block in start_subprocess'
#<Thread:0x00000[26](https://github.com/rubygems/rubygems/actions/runs/5286199021/jobs/9568614121?pr=6739#step:8:27)a05473df0 C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:174 run> terminated with exception (report_on_exception is true):
C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `initialize': No such file or directory @ rb_sysopen - tmp/test-pipes/subprocess-2 (Errno::ENOENT)
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `open'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:175:in `block in start_subprocess'
C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:217:in `pop': No live threads left. Deadlock? (fatal)
1 threads, 1 sleeps current:0x0000026a04fb9f20 main thread:0x0000026a7eb19e60
* #<Thread:0x0000026a7f01c4[30](https://github.com/rubygems/rubygems/actions/runs/5286199021/jobs/9568614121?pr=6739#step:8:31) sleep_forever>
   rb_thread_t:0x0000026a7eb19e60 native:0x000000000000016c int:0
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:217:in `pop'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:217:in `block in handle_messages'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:216:in `loop'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:216:in `handle_messages'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:93:in `run'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:[38](https://github.com/rubygems/rubygems/actions/runs/5286199021/jobs/9568614121?pr=6739#step:8:39):in `run'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/cli.rb:96:in `run'
   C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/bin/turbo_tests:11:in `<top (required)>'
   D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:103:in `load'
   D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:103:in `gem_load_and_activate'
   D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:18:in `gem_load'
   bin/parallel_rspec:17:in `<main>'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:217:in `block in handle_messages'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:216:in `loop'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:216:in `handle_messages'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:93:in `run'
2 processes for 170 specs, ~ 85 specs per process
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/runner.rb:38:in `run'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/lib/turbo_tests/cli.rb:96:in `run'
    from C:/hostedtoolcache/windows/Ruby/2.7.7/x64/lib/ruby/gems/2.7.0/gems/turbo_tests-2.1.0/bin/turbo_tests:11:in `<top (required)>'
    from D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:103:in `load'
    from D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:103:in `gem_load_and_activate'
    from D:/a/rubygems/rubygems/bundler/spec/support/rubygems_ext.rb:18:in `gem_load'
    from bin/parallel_rspec:17:in `<main>'

I applied another workaround of https://github.com/rubygems/rubygems/pull/6739 and run RubyGems/Bundler with Windows platform. turbo_tests is still not working.

ilyazub commented 1 year ago

Thanks for raising this issue!

From what I remember, an extra FIFO was needed to catch errors outside of examples: https://github.com/serpapi/turbo_tests/pull/10.

If it'll work with stdout instead of tmp/test-pipes, let's do this.

ilyazub commented 11 months ago

ruby/mspec doesn't use FIFO too (ref: https://github.com/ruby/mspec/blob/b23f052a8d262ebd442e60e23d468ed82852f3d8/lib/mspec/runner/parallel.rb#L76-L97)

I'll explore that.

deivid-rodriguez commented 11 months ago

Interesting!

Our approach in RubyGems seem to be working just fine on Windows. Feel free to cherry-pick that if preferred.

deivid-rodriguez commented 4 months ago

Can be closed now! :tada:

hsbt commented 4 months ago

Thanks all 👍