Skip to content

Commit dbcf6f3

Browse files
committed
Use Thread#join without a duration
* Time varies a lot in CI, using a duration is making tests more flaky.
1 parent 2a65de5 commit dbcf6f3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/lint/streams.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def test_xread_does_not_raise_timeout_error_when_the_block_option_is_zero_msec
427427
Thread.pass until prepared
428428
redis2 = init _new_client
429429
redis2.xadd('s1', { f: 'v1' }, id: '0-1')
430-
thread.join(3)
430+
thread.join
431431

432432
assert_equal(['v1'], actual.fetch('s1').map { |i| i.last['f'] })
433433
end

test/redis/publish_subscribe_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def teardown
1919
end
2020
redis.close
2121
begin
22-
thread.join(2) or warn("leaked thread")
22+
thread.join
2323
rescue RedisClient::ConnectionError
2424
end
2525
end
@@ -296,7 +296,7 @@ def test_unsubscribe_from_another_thread
296296
assert_empty @messages
297297

298298
@subscribed_redis.unsubscribe # this shouldn't block
299-
refute_nil thread.join(2)
299+
thread.join
300300
assert_equal true, @unsubscribed
301301
end
302302

@@ -329,7 +329,7 @@ def test_subscribe_from_another_thread
329329
@subscribed_redis.unsubscribe(channel_name)
330330
@subscribed_redis.unsubscribe # this shouldn't block
331331

332-
refute_nil thread.join(2)
332+
thread.join
333333
expected = [
334334
["subscribed", channel_name],
335335
["message", channel_name, "test"],

0 commit comments

Comments
 (0)