Skip to content
Browse files

Ensure threads finish running for time zone thread safety test.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9136 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3e73278 commit 37a004ded484dea088ddbf594216c308e878ce3d @josh josh committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 activesupport/test/core_ext/time_with_zone_test.rb
View
6 activesupport/test/core_ext/time_with_zone_test.rb
@@ -486,8 +486,10 @@ def test_time_zone_getter_and_setter_with_zone_default
def test_time_zone_setter_is_thread_safe
Time.use_zone 'Paris' do
- t1 = Thread.new { Time.zone = 'Alaska' }
- t2 = Thread.new { Time.zone = 'Hawaii' }
+ t1 = Thread.new { Time.zone = 'Alaska' }.join
+ t2 = Thread.new { Time.zone = 'Hawaii' }.join
+ assert t1.stop?, "Thread 1 did not finish running"
+ assert t2.stop?, "Thread 2 did not finish running"
assert_equal TimeZone['Paris'], Time.zone
assert_equal TimeZone['Alaska'], t1[:time_zone]
assert_equal TimeZone['Hawaii'], t2[:time_zone]

0 comments on commit 37a004d

Please sign in to comment.
Something went wrong with that request. Please try again.