mirror of
https://github.com/github/rails.git
synced 2026-01-28 15:58:03 -05:00
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
This commit is contained in:
@@ -486,8 +486,10 @@ uses_tzinfo 'TimeWithZoneTest' do
|
||||
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user