Skip to content

Commit f2ce248

Browse files
committed
Fix timeout settings because CI occasionally fail at JRuby
1 parent 1eb281d commit f2ce248

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

.travis.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
global:
2727
- VERBOSE=true
2828
- TIMEOUT=30
29+
- LOW_TIMEOUT=0.01
2930
matrix:
3031
- DRIVER=ruby REDIS_BRANCH=3.0
3132
- DRIVER=ruby REDIS_BRANCH=3.2
@@ -43,17 +44,14 @@ branches:
4344

4445
matrix:
4546
exclude:
46-
# hiredis
4747
- rvm: jruby-9.1.17.0
48-
env: DRIVER=hiredis REDIS_BRANCH=3.0
48+
include:
4949
- rvm: jruby-9.1.17.0
50-
env: DRIVER=hiredis REDIS_BRANCH=3.2
51-
52-
# synchrony
50+
env: DRIVER=ruby REDIS_BRANCH=3.0 LOW_TIMEOUT=0.1
5351
- rvm: jruby-9.1.17.0
54-
env: DRIVER=synchrony REDIS_BRANCH=3.0
52+
env: DRIVER=ruby REDIS_BRANCH=3.2 LOW_TIMEOUT=0.1
5553
- rvm: jruby-9.1.17.0
56-
env: DRIVER=synchrony REDIS_BRANCH=3.2
54+
env: DRIVER=ruby REDIS_BRANCH=4.0 LOW_TIMEOUT=0.1
5755

5856
notifications:
5957
irc:

test/cluster_client_options_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def test_client_accepts_valid_node_configs
3838

3939
def test_client_accepts_valid_options
4040
assert_nothing_raised do
41-
timeout = Float(ENV['TIMEOUT'] || 1.0)
42-
build_another_client(timeout: timeout)
41+
build_another_client(timeout: TIMEOUT)
4342
end
4443
end
4544

test/helper.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
require_relative "support/connection/#{ENV["DRIVER"]}"
1616
require_relative 'support/cluster/orchestrator'
1717

18-
PORT = 6381
19-
OPTIONS = {:port => PORT, :db => 15, :timeout => Float(ENV["TIMEOUT"] || 0.1)}
20-
NODES = ["redis://127.0.0.1:#{PORT}/15"]
18+
PORT = 6381
19+
DB = 15
20+
TIMEOUT = Float(ENV['TIMEOUT'] || 0.1)
21+
LOW_TIMEOUT = Float(ENV['LOW_TIMEOUT'] || 0.01) # for blocking-command tests
22+
OPTIONS = { port: PORT, db: DB, timeout: TIMEOUT }.freeze
2123

2224
def driver(*drivers, &blk)
2325
if drivers.map(&:to_s).include?(ENV["DRIVER"])
@@ -178,9 +180,10 @@ def _new_client(options = {})
178180
end
179181

180182
module Distributed
181-
182183
include Generic
183184

185+
NODES = ["redis://127.0.0.1:#{PORT}/15"].freeze
186+
184187
def version
185188
Version.new(redis.info.first["redis_version"])
186189
end

test/lint/blocking_commands.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module Lint
22
module BlockingCommands
3-
LOW_TIMEOUT = 0.01
4-
53
def setup
64
super
75

0 commit comments

Comments
 (0)