KnapsackPro / knapsack_pro-ruby

Knapsack Pro gem splits tests across parallel CI nodes and makes sure that tests run in optimal time
https://knapsackpro.com
MIT License
131 stars 27 forks source link

Ruby 3.3 support? #255

Closed mikebaldry closed 3 months ago

mikebaldry commented 3 months ago

I tried running our test suite against Ruby 3.3.1 today and the tests just never finished on multiple workers. They were just sitting there doing nothing and I killed the build after an hour.

I initially thought this was something Ruby related, but after removing Knapsack from our CI scripts, everything works.

3v0k4 commented 3 months ago

Hi Mike, I'm sorry for the troubles.

Knapsack is tested with Ruby 3.3.1—I just double checked that CircleCI resolves 3.3 to 3.3.1.

Could you please send an email to support@knapsackpro.com with the following info:

Here are a couple of strategies you could use to debug the issue:

To print the backtrace(s) you can do the following:

1) Add the following to spec_helper.rb:

puts "Process pid: #{Process.pid}"

trap 'USR1' do
  threads = Thread.list

  puts
  puts "=" * 80
  puts "Received USR1 signal; printing all #{threads.count} thread backtraces."

  threads.each do |thr|
    description = thr == Thread.main ? "Main thread" : thr.inspect
    puts
    puts "#{description} backtrace: "
    puts thr.backtrace.join("\n")
  end

  puts "=" * 80
end

2) Run Knapsack with timeout --signal=USR1 30 bundle exec rake "knapsack_pro:queue:rspec[--format d]"

Notice that 30 is in seconds, so you may want to increase that number to make sure timeout sends USR1 when the process is stuck and not before.

3) Check the logs for information. Please share them with us if you attempt this.

mikebaldry commented 3 months ago

I'm running through these steps now, I'll email over to you with my findings.

Thanks

ArturT commented 3 months ago

Summary after private conversation.

Disabling YJIT helps.

The issue might be related to YJIT:

ArturT commented 3 months ago

I'm closing this issue because disabling YJIT helped.

@mikebaldry I've replied in our private conversation. Please let me know if you need more help.