Skip to content

Commit 28e8a26

Browse files
committed
fix
1 parent 7fea981 commit 28e8a26

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
require:
2+
plugins:
33
- rubocop-performance
44
- rubocop-rake
55
- rubocop-minitest

test/prof_stack2.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def run
1616

1717
case mode = ENV.fetch('PROFILE_MODE', :single).to_sym
1818
when :single
19-
execute(client, mode) do |client|
20-
ATTEMPTS.times { |i| client.call('get', "key#{i}") }
19+
execute(client, mode) do |cli|
20+
ATTEMPTS.times { |i| cli.call('get', "key#{i}") }
2121
end
2222
when :transaction
23-
execute(client, mode) do |client|
23+
execute(client, mode) do |cli|
2424
ATTEMPTS.times do |i|
25-
client.multi do |tx|
25+
cli.multi do |tx|
2626
SIZE.times do |j|
2727
n = SIZE * i + j
2828
tx.call('set', "{group:#{i}}:key:#{n}", n)
@@ -31,9 +31,9 @@ def run
3131
end
3232
end
3333
when :pipeline
34-
execute(client, mode) do |client|
34+
execute(client, mode) do |cli|
3535
ATTEMPTS.times do |i|
36-
client.pipelined do |pi|
36+
cli.pipelined do |pi|
3737
SIZE.times do |j|
3838
n = SIZE * i + j
3939
pi.call('get', "key#{n}")

test/testing_constants.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
raise NotImplementedError, TEST_REDIS_HOST
7777
end
7878

79-
Ractor.make_shareable(TEST_NODE_URIS) if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
80-
8179
TEST_GENERIC_OPTIONS = (TEST_REDIS_SSL ? _base_opts.merge(_ssl_opts) : _base_opts).freeze
8280

8381
_tmp_cli = _new_raw_cli.call(**TEST_GENERIC_OPTIONS)
@@ -88,4 +86,9 @@
8886
BENCH_ENVOY_OPTIONS = { port: 7000, protocol: 2 }.freeze
8987
BENCH_REDIS_CLUSTER_PROXY_OPTIONS = { port: 7001, protocol: 2 }.freeze
9088

89+
if Object.const_defined?(:Ractor, false) && Ractor.respond_to?(:make_shareable)
90+
Ractor.make_shareable(TEST_NODE_URIS)
91+
Ractor.make_shareable(TEST_GENERIC_OPTIONS)
92+
end
93+
9194
# rubocop:enable Lint/UnderscorePrefixedVariableName

0 commit comments

Comments
 (0)