parallel_tests 5.3.0 → 5.3.1

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: a7a2c5d683029ce50e608bd13d0d3d7490f3c3bcd29180a311383c9c4ae8c698
4
- data.tar.gz: 6c779e00cf55b4bb34f740fb791b857b3ddeaaf42a5d595d207326184ddc0b91
3
+ metadata.gz: 976016bff736bf3c0a3318b375b57575596a97185e25e5991c1e4bf3853a359f
4
+ data.tar.gz: 970d5aa2f19a5166ce304d686681583ba20990439893e82c59926453f7d32277
5
5
  SHA512:
6
- metadata.gz: f363d5971f4a53180b4db97ec016b63a35e59dbf4d0416f71737e4b2e5e7c8c8aece067b45a80249123acf3c57761f6cf4daf12958ba00281e909122617e3eaf
7
- data.tar.gz: 4524b05659ca8b2468023adbb1c28f41be9738230295ec630a8d8b85f74e804143a3ad3c42dddaa9a95cd0111a3530374ef0f101714ee849f402bbecdb2614cf
6
+ metadata.gz: 0cc814265ca73b3ced92dad469fe94b42d9068aa29cc1ff218a74c920ef3d7c286eef27d6864b555852de6257cd2d041d801373a30c81936181bd5a7e612e672
7
+ data.tar.gz: feb60ffbb3b67da7990e406471bd4a8f6b4144453bc307bf33fdeca62111ed3744ca3a1a4e0fad2a80064e6db441aa68b18fb076d86586d8768d98a4f68ddbd3
data/Readme.md CHANGED
@@ -101,17 +101,23 @@ require "parallel_tests"
101
101
 
102
102
  # preparation:
103
103
  # affected by race-condition: first process may boot slower than the second
104
- # either sleep a bit or use a lock for example File.lock
105
- ParallelTests.first_process? ? do_something : sleep(1)
104
+ # the Process.ppid will be the pod of the process that started the parallel tests
105
+ # when not using TEST_ENV_NUMBER we use a unique file per process because ppid would be the users shell
106
+ done = "/tmp/parallel-setup-done-#{ENV['TEST_ENV_NUMBER'] ? Process.ppid : Process.pid}"
107
+ if ParallelTests.first_process?
108
+ do_something
109
+ File.write done, "true"
110
+ else
111
+ sleep 0.1 until File.exist?(done)
112
+ end
106
113
 
107
114
  # cleanup:
108
- # last_process? does NOT mean last finished process, just last started
109
- ParallelTests.last_process? ? do_something : sleep(1)
110
-
115
+ # could also use last_process? but that is just the last process to start, not the last to finish
111
116
  at_exit do
112
117
  if ParallelTests.first_process?
113
- ParallelTests.wait_for_other_processes_to_finish
114
- undo_something
118
+ File.unlink done
119
+ ParallelTests.wait_for_other_processes_to_finish
120
+ undo_something
115
121
  end
116
122
  end
117
123
  ```
@@ -15,7 +15,7 @@ module ParallelTests
15
15
  ENV['DISABLE_SPRING'] ||= '1'
16
16
 
17
17
  num_processes = ParallelTests.determine_number_of_processes(options[:count])
18
- num_processes = (num_processes * ParallelTests.determine_multiple(options[:multiply])).round
18
+ num_processes = (num_processes * ParallelTests.determine_multiple(options[:multiply_processes])).round
19
19
 
20
20
  options[:first_is_1] ||= first_is_1?
21
21
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '5.3.0'
3
+ VERSION = '5.3.1'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-30 00:00:00.000000000 Z
11
+ date: 2025-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -69,9 +69,9 @@ licenses:
69
69
  - MIT
70
70
  metadata:
71
71
  bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
72
- changelog_uri: https://github.com/grosser/parallel_tests/blob/v5.3.0/CHANGELOG.md
73
- documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.3.0/Readme.md
74
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.3.0
72
+ changelog_uri: https://github.com/grosser/parallel_tests/blob/v5.3.1/CHANGELOG.md
73
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.3.1/Readme.md
74
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.3.1
75
75
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
76
76
  rubygems_mfa_required: 'true'
77
77
  post_install_message: