Improve debugging for hanging CI node. Show hanging spec files in the RSpec output and a command to reproduce the current batch of tests #287
Conversation
This reverts commit 430253a.
| puts 'Use the following backtrace(s) to find the line of code that got stuck if the CI node hung and terminated your tests.' | ||
| puts 'How to read the backtrace: https://knapsackpro.com/perma/ruby/backtrace-debugging' | ||
|
|
||
| post_log_threads(threads) |
There was a problem hiding this comment.
plea
"Post" does not work because this happens in the middle of log_threads. What about log_current_tests?
Also, we are using both log and print, maybe we should converge into one?
There was a problem hiding this comment.
Also, we are using both log and print, maybe we should converge into one?
Are you referring to the log_current_tests method implemented in the child class (lib/knapsack_pro/runners/queue/rspec_runner.rb)?
We use puts to print info to stdout there. You can't write to a log file from inside of a trap.
I think the general name log_current_tests is fine. We log stuff, under the hood they are logged to stdout.
There was a problem hiding this comment.
There's an inconsistency: print_current_batch_rspec_command uses puts, log_current_tests uses puts.
So they both use puts but why is one called "print" and the other "log"?
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
Failure/Error: expect(actual.stdout).to match(/spec_integration\/b_spec\.rb:7:in .*kill/).twice
NoMethodError:
undefined method `twice' for an instance of RSpec::Matchers::BuiltIn::Match
| puts 'Use the following backtrace(s) to find the line of code that got stuck if the CI node hung and terminated your tests.' | ||
| puts 'How to read the backtrace: https://knapsackpro.com/perma/ruby/backtrace-debugging' | ||
|
|
||
| post_log_threads(threads) |
There was a problem hiding this comment.
There's an inconsistency: print_current_batch_rspec_command uses puts, log_current_tests uses puts.
So they both use puts but why is one called "print" and the other "log"?
Co-authored-by: Riccardo <riccardo.odone@gmail.com>
Ok. I'll do log_current_batch_rspec_command. log is a higher abstraction than print. |
Story
https://trello.com/c/xvarNSRi
Related
Issue:
Related PR:
Description
Improve debugging for hanging CI node.
Checklist reminder
UNRELEASEDsection of theCHANGELOG.md, including the needed bump (ie, patch, minor, major)lib/knapsack_pro/pure/queue/rspec_pure.rbcontains pure functions that are unit tested.lib/knapsack_pro/extensions/rspec_extension.rbencapsulates calls to RSpec internals and is integration and e2e tested.lib/knapsack_pro/runners/queue/rspec_runner.rbinvokes the pure code and the extension to produce side effects, which are integration and e2e tested.