Skip to content

Commit

Permalink
Merge pull request #116 from kbrock/thread_safety2
Browse files Browse the repository at this point in the history
fix sporadic thread_safety test failure
  • Loading branch information
Fryguy authored Feb 29, 2024
2 parents c574a2c + 84883a9 commit ca98f72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/core_ext/module/cache_with_timeout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
# clears the current value, the other thread could get nil.
test_class.cache_with_timeout(:thread_safety) { 2 }

Thread.new do
t = Thread.new do
10000.times do
test_class.thread_safety(true)
end
Expand All @@ -172,6 +172,7 @@
10000.times do
expect(test_class.thread_safety).to eq(2)
end
t.join
end
end
end

0 comments on commit ca98f72

Please sign in to comment.