Skip to content

Commit

Permalink
Explicitly define joined Threads in PrepareCommitMsg concurrency spec
Browse files Browse the repository at this point in the history
  • Loading branch information
fulf committed Feb 24, 2024
1 parent 5dcd75d commit 6a5d4c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/overcommit/hook/prepare_commit_msg/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
contents + "bravo\n"
end
end
Thread.new { hook_1.run }
Thread.new { hook_2.run }
Thread.list.each { |t| t.join unless t == Thread.current }
t1 = Thread.new { hook_1.run }
t2 = Thread.new { hook_2.run }
[t1, t2].each(&:join)
expect(File.read(tempfile)).to match(/alpha\n#{initial_content}bravo\n/m)
end
end
Expand Down

0 comments on commit 6a5d4c6

Please sign in to comment.