knapsack_pro 7.6.2 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1fd5c8d52aa9de26d125b40b1c3b60ee7536a75e9351b524ad9d99386fd6bfc8
4
- data.tar.gz: 491d49252b139b817939ef4555a36fba6ca6ca74cc70e9a325124e0a900bb5ab
3
+ metadata.gz: 305d35a49e09ed66729fda89d59557df29b05f260ad7495cf7c37f5e886f55f8
4
+ data.tar.gz: 07efa1a33e29ea7d0ea8b83e7134558dda4e94e14c3753d386cb5d46ad8e1dee
5
5
  SHA512:
6
- metadata.gz: f1b030ead892b4251f9e191049425675105940777e5061a81e23b90ce8481e3a0564832068202d56d912afe62e5e92482a771f06e7c3faeaf331dc5d772a583c
7
- data.tar.gz: 82f5ba33b17213da4b7a7b8e2647042559b52ac12c0aae7255f838ed4e6ed70d0fab80d7009434855e58c1c63d3c11fb9cfe69f85fab5968fa37edc3005d1250
6
+ metadata.gz: 0b3af0a93381d94a03afa13a3bddb9de2c2b91958ffb8b0d83707c168300a51bf863d6907ce3b5f2cbe22fc87954fe01f4b61557b9cafddceabd35ba541a2344
7
+ data.tar.gz: f195aebb076beac551dbd4923fdb516d08d2d2f15d6b663499be5ed432dc502048a93bafdd48ff46f1632ac1d9adf5de2e4c261a9c4d80a9eab31e2ddb62a5e6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ### UNRELEASED
4
4
 
5
+ ### 7.8.0
6
+
7
+ * Add a link to help you read the backtrace.
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/267
10
+
11
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.7.0...v7.8.0
12
+
13
+ ### 7.7.0
14
+
15
+ * Log threads when the OS signal is received to simplify debugging, especially when a CI node hangs.
16
+
17
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/266
18
+
19
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v7.6.2...v7.7.0
20
+
5
21
  ### 7.6.2
6
22
 
7
23
  * Fix an error for the `KnapsackPro::Formatters::TimeTracker` formatter in RSpec when using Knapsack Pro Regular Mode and the `.rspec` file is not present.
@@ -59,9 +59,38 @@ module KnapsackPro
59
59
  Signal.trap(signal) {
60
60
  puts "#{signal} signal has been received. Terminating Knapsack Pro..."
61
61
  @@terminate_process = true
62
+ log_threads
62
63
  }
63
64
  end
64
65
  end
66
+
67
+ def log_threads
68
+ threads = Thread.list
69
+
70
+ puts
71
+ puts '=' * 80
72
+ puts "Start logging #{threads.count} detected threads."
73
+ puts 'Use the following backtrace(s) to find the line of code that got stuck if the CI node hung and terminated your tests.'
74
+ puts 'How to read the backtrace: https://knapsackpro.com/perma/ruby/backtrace-debugging'
75
+
76
+ threads.each do |thread|
77
+ puts
78
+ if thread == Thread.main
79
+ puts "Main thread backtrace:"
80
+ else
81
+ puts "Non-main thread inspect: #{thread.inspect}"
82
+ puts "Non-main thread backtrace:"
83
+ end
84
+ puts thread.backtrace.join("\n")
85
+ puts
86
+ end
87
+
88
+ puts
89
+ puts 'End logging threads.'
90
+ puts '=' * 80
91
+
92
+ $stdout.flush
93
+ end
65
94
  end
66
95
  end
67
96
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KnapsackPro
4
- VERSION = '7.6.2'
4
+ VERSION = '7.8.0'
5
5
  end
@@ -1318,6 +1318,12 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
1318
1318
  describe 'A_describe' do
1319
1319
  it 'A1 test example' do
1320
1320
  expect(1).to eq 1
1321
+
1322
+ Thread.new do
1323
+ sleep 10
1324
+ end
1325
+
1326
+ sleep 1 # wait for the above async thread to start
1321
1327
  end
1322
1328
  end
1323
1329
  SPEC
@@ -1406,6 +1412,14 @@ describe "#{KnapsackPro::Runners::Queue::RSpecRunner} - Integration tests", :cle
1406
1412
  OUTPUT
1407
1413
  )
1408
1414
 
1415
+
1416
+ expect(actual.stdout).to include('Use the following backtrace(s) to find the line of code that got stuck if the CI node hung and terminated your tests.')
1417
+ expect(actual.stdout).to include('Main thread backtrace:')
1418
+ expect(actual.stdout).to include("spec_integration/b_spec.rb:7:in `kill'")
1419
+ expect(actual.stdout).to include('Non-main thread backtrace:')
1420
+ expect(actual.stdout).to include("spec_integration/a_spec.rb:6:in `sleep'")
1421
+
1422
+
1409
1423
  expect(actual.exit_code).to eq 1
1410
1424
  end
1411
1425
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.2
4
+ version: 7.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-27 00:00:00.000000000 Z
11
+ date: 2024-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -415,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
415
415
  - !ruby/object:Gem::Version
416
416
  version: '0'
417
417
  requirements: []
418
- rubygems_version: 3.5.9
418
+ rubygems_version: 3.5.11
419
419
  signing_key:
420
420
  specification_version: 4
421
421
  summary: Knapsack Pro splits tests across parallel CI nodes and ensures each parallel