Skip to content

Commit 48b2789

Browse files
authored
Merge pull request #1128 from redis/lower-ci-timeout
Lower client timeout on CI
2 parents 85753ef + b78faa2 commit 48b2789

File tree

2 files changed

+50
-22
lines changed

2 files changed

+50
-22
lines changed

.github/workflows/test.yaml

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
lint:
1212
name: Rubocop
13-
timeout-minutes: 30
13+
timeout-minutes: 15
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Check out code
@@ -29,19 +29,15 @@ jobs:
2929

3030
rubies:
3131
name: Ruby
32-
timeout-minutes: 30
32+
timeout-minutes: 15
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
ruby: ["3.1", "3.0", "2.7", "2.6", "2.5", "jruby-9.3.6.0", "truffleruby-22.2.0"]
36+
ruby: ["3.1", "3.0", "2.7", "2.6", "2.5", "jruby-9.3.6.0"]
3737
runs-on: ubuntu-latest
3838
env:
39-
VERBOSE: "true"
40-
TIMEOUT: "30"
4139
LOW_TIMEOUT: "0.01"
42-
DRIVER: ruby
4340
REDIS_BRANCH: "7.0"
44-
TRUFFLERUBYOPT: "--engine.Mode=latency"
4541
steps:
4642
- name: Check out code
4743
uses: actions/checkout@v3
@@ -68,17 +64,53 @@ jobs:
6864
- name: Shutting down Redis
6965
run: make stop
7066

67+
truffle:
68+
name: TruffleRuby
69+
timeout-minutes: 15
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
suite: ["redis", "distributed"]
74+
runs-on: ubuntu-latest
75+
env:
76+
LOW_TIMEOUT: "0.01"
77+
REDIS_BRANCH: "7.0"
78+
TRUFFLERUBYOPT: "--engine.Mode=latency"
79+
steps:
80+
- name: Check out code
81+
uses: actions/checkout@v3
82+
- name: Print environment variables
83+
run: |
84+
echo "TIMEOUT=${TIMEOUT}"
85+
echo "LOW_TIMEOUT=${LOW_TIMEOUT}"
86+
echo "DRIVER=${DRIVER}"
87+
echo "REDIS_BRANCH=${REDIS_BRANCH}"
88+
- name: Set up Ruby
89+
uses: ruby/setup-ruby@v1
90+
with:
91+
ruby-version: truffleruby-22.2.0
92+
bundler-cache: true
93+
- name: Cache local temporary directory
94+
uses: actions/cache@v3
95+
with:
96+
path: tmp
97+
key: "local-tmp-redis-7.0-on-ubuntu-latest"
98+
- name: Booting up Redis
99+
run: make start
100+
- name: Test
101+
run: bundle exec rake test:${{ matrix.suite }}
102+
- name: Shutting down Redis
103+
run: make stop
104+
71105
drivers:
72106
name: Driver
73-
timeout-minutes: 30
107+
timeout-minutes: 15
74108
strategy:
75109
fail-fast: false
76110
matrix:
77111
driver: ["hiredis"]
78112
runs-on: ubuntu-latest
79113
env:
80-
VERBOSE: "true"
81-
TIMEOUT: "30"
82114
LOW_TIMEOUT: "0.01"
83115
DRIVER: ${{ matrix.driver }}
84116
REDIS_BRANCH: "7.0"
@@ -110,17 +142,14 @@ jobs:
110142

111143
redises:
112144
name: Redis
113-
timeout-minutes: 30
145+
timeout-minutes: 15
114146
strategy:
115147
fail-fast: false
116148
matrix:
117149
redis: ["6.2", "6.0", "5.0"]
118150
runs-on: ubuntu-latest
119151
env:
120-
VERBOSE: "true"
121-
TIMEOUT: "30"
122152
LOW_TIMEOUT: "0.14"
123-
DRIVER: ruby
124153
REDIS_BRANCH: ${{ matrix.redis }}
125154
steps:
126155
- name: Check out code
@@ -150,15 +179,12 @@ jobs:
150179

151180
sentinel:
152181
name: Sentinel
153-
timeout-minutes: 30
182+
timeout-minutes: 15
154183
strategy:
155184
fail-fast: false
156185
runs-on: ubuntu-latest
157186
env:
158-
VERBOSE: "true"
159-
TIMEOUT: "30"
160187
LOW_TIMEOUT: "0.14"
161-
DRIVER: ruby
162188
REDIS_BRANCH: "7.0"
163189
steps:
164190
- name: Check out code
@@ -188,15 +214,13 @@ jobs:
188214

189215
cluster:
190216
name: Cluster
191-
timeout-minutes: 30
217+
timeout-minutes: 15
192218
strategy:
193219
fail-fast: false
194220
runs-on: ubuntu-latest
195221
env:
196-
VERBOSE: "true"
197-
TIMEOUT: "30"
222+
TIMEOUT: "15"
198223
LOW_TIMEOUT: "0.14"
199-
DRIVER: ruby
200224
REDIS_BRANCH: "7.0"
201225
BUNDLE_GEMFILE: redis_cluster/Gemfile
202226
steps:

test/redis/internals_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ def test_large_payload
99
# see: https://github.com/redis/redis-rb/issues/962
1010
# large payloads will trigger write_nonblock to write a portion
1111
# of the payload in connection/ruby.rb _write_to_socket
12+
13+
# We use a larger timeout for TruffleRuby
14+
# https://github.com/redis/redis-rb/pull/1128#issuecomment-1218490684
15+
r = init(_new_client(timeout: TIMEOUT * 5))
1216
large = "\u3042" * 4_000_000
1317
r.setex("foo", 10, large)
1418
result = r.get("foo")

0 commit comments

Comments
 (0)