Skip to content

Commit f9fbe5c

Browse files
committed
Add test to prove that we fixed inconsistencies with timeouts.
See 6737893.
1 parent 6737893 commit f9fbe5c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/connection_handling_test.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,23 @@ def test_config_set
186186
r.config :set, "timeout", 300
187187
end
188188
end
189+
190+
def test_consistency_on_multithreaded_env
191+
t = nil
192+
193+
commands = {
194+
:set => lambda { |key, value| t.kill; "+OK\r\n" },
195+
:incr => lambda { |key| ":1\r\n" },
196+
}
197+
198+
redis_mock(commands) do |redis|
199+
t = Thread.new do
200+
redis.set("foo", "bar")
201+
end
202+
203+
t.join
204+
205+
assert_equal 1, redis.incr("baz")
206+
end
207+
end
189208
end

0 commit comments

Comments
 (0)