Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix double int without breaking stdin #891

Merged
merged 1 commit into from
Feb 6, 2023
Merged

fix double int without breaking stdin #891

merged 1 commit into from
Feb 6, 2023

Conversation

grosser
Copy link
Owner

@grosser grosser commented Feb 4, 2023

reproduction:

source "https://rubygems.org"

gem "parallel_tests", path: "~/Code/tools/parallel_tests"
gem "minitest"
gem "rspec"

# a_spec.rb
sleep 5; describe { specify { 'Should not get here' }; specify { p 'Should not get here either'} }

# a_test.rb
require "minitest/autorun"

describe "foo" do
  it "do" do
    # binding.irb
    puts "foo"
    sleep 10
  end
end

trap("SIGINT")  do
  puts "GOT INT A"
  $stdout.flush
end
  • run test and Ctrl+c -> 1 GOT INT
  • run test and uncomment binding.irb shell works
  • run spec and interrupt -> does not run tests

issues:
integration test fails ... I think this is because it's not a cgroup so the signal does not reach all tests
so I expect this to also happen on CI which could mean tests hang forever
also tried with (parallel_rspec test/a_spec.rb -n 2 &) and then kill -int but also worked

@grosser
Copy link
Owner Author

grosser commented Feb 4, 2023

this seems to work for

  • foreground
  • background
  • started via integration test
    ... so I hope that covers all cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant