Skip to content

Commit

Permalink
ci: add a case to the test for the iteration per second (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed May 3, 2024
1 parent 9d394bf commit a13e363
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/ips_mget.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,21 @@ def prepare(client)
def bench(cmd, client)
original = [cmd] + Array.new(ATTEMPTS) { |i| "{key}#{i}" }
emulated = [cmd] + Array.new(ATTEMPTS) { |i| "key#{i}" }
single_get = [cmd]

Benchmark.ips do |x|
x.time = 5
x.warmup = 1
x.report("#{cmd}: original") { client.call_v(original) }
x.report("#{cmd}: emulated") { client.call_v(emulated) }

x.report("#{cmd}: single_get") do
ATTEMPTS.times do |i|
single_get[1] = "key#{i}"
client.call_v(single_get)
end
end

x.compare!
end
end
Expand Down
3 changes: 3 additions & 0 deletions test/redis_client/test_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ def test_transaction_does_not_pointlessly_unwatch_on_success
tx.call('SET', '{key}1', '1')
tx.call('SET', '{key}2', '2')
end

assert_equal(%w[WATCH MULTI SET SET EXEC], @captured_commands.to_a.map(&:command).map(&:first))

wait_for_replication
assert_equal(%w[1 2], @client.call('MGET', '{key}1', '{key}2'))
end

Expand Down

0 comments on commit a13e363

Please sign in to comment.