Skip to content

Commit

Permalink
Exclude timeout tests from JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoldstein committed Oct 14, 2021
1 parent 2aea911 commit 4a6a5ad
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions test/test_failover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@
require_relative "helper"

describe "failover" do
describe "timeouts" do
it "not lead to corrupt sockets" do
memcached_persistent do |dc|
value = {test: "123"}
begin
Timeout.timeout 0.01 do
start_time = Time.now
100_000.times do
dc.set("test_123", value)
# Timeouts on JRuby work differently and aren't firing, meaning we're
# not testing the condition
unless defined? JRUBY_VERSION
describe "timeouts" do
it "not lead to corrupt sockets" do
memcached_persistent do |dc|
value = {test: "123"}
begin
Timeout.timeout 0.01 do
start_time = Time.now
10_000.times do
dc.set("test_123", value)
end
flunk("Did not timeout in #{Time.now - start_time}")
end
flunk("Did not timeout in #{Time.now - start_time}")
rescue Timeout::Error
end
rescue Timeout::Error
end

assert_equal(value, dc.get("test_123"))
assert_equal(value, dc.get("test_123"))
end
end
end
end
Expand Down

0 comments on commit 4a6a5ad

Please sign in to comment.