Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unstable test cases #896

Merged
merged 2 commits into from Mar 30, 2020
Merged

Conversation

@supercaracal
Copy link
Contributor

supercaracal commented Mar 28, 2020

The following test case have been becoming unstable since I added several replica and Sentinel nodes for test. (ref: #816 #895)

def test_info_commandstats
target_version "2.5.7" do
r.nodes.each { |n| n.config(:resetstat) }
r.ping # Executed on every node
r.info(:commandstats).each do |info|
assert_equal "1", info["ping"]["calls"]
end
end
end

Sentinels keep pinging to the node for monitoring. So the stats was unintentionally incremented. I modified as not using PING stats.

irb(main):032:0> r.info(:commandstats).keys
=> ["publish", "ping", "info", "replconf", "config"]
irb(main):033:0> r.info(:commandstats)['ping']
=> {"calls"=>"51", "usec"=>"109", "usec_per_call"=>"2.14"}

irb(main):034:0> r.info(:commandstats)['ping']
=> {"calls"=>"56", "usec"=>"116", "usec_per_call"=>"2.07"}

irb(main):035:0> r.info(:commandstats)['ping']
=> {"calls"=>"63", "usec"=>"127", "usec_per_call"=>"2.02"}
irb(main):057:0> r.config :resetstat
=> "OK"

irb(main):058:0> r.info(:commandstats)['config']
=> {"calls"=>"1", "usec"=>"18", "usec_per_call"=>"18.00"}

irb(main):059:0> r.info(:commandstats)['config']
=> {"calls"=>"1", "usec"=>"18", "usec_per_call"=>"18.00"}

irb(main):060:0> r.config :get, 'port'
=> {"port"=>"6381"}

irb(main):061:0> r.info(:commandstats)['config']
=> {"calls"=>"2", "usec"=>"46", "usec_per_call"=>"23.00"}
@supercaracal supercaracal changed the title Fix a unstable test case Fix unstable test cases Mar 28, 2020
@byroot byroot merged commit 45666da into redis:master Mar 30, 2020
21 checks passed
21 checks passed
Main (ubuntu-latest, 5.0, 2.7, ruby)
Details
Main (ubuntu-latest, 5.0, 2.7, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.7, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.6, ruby)
Details
Main (ubuntu-latest, 5.0, 2.6, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.6, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.5, ruby)
Details
Main (ubuntu-latest, 5.0, 2.5, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.5, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.4, ruby)
Details
Main (ubuntu-latest, 5.0, 2.4, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.4, synchrony)
Details
Sub (ubuntu-latest, 5.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 5.0, 2.3, ruby)
Details
Sub (ubuntu-latest, 4.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 4.0, 2.3, ruby)
Details
Sub (ubuntu-latest, 3.2, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 3.2, 2.3, ruby)
Details
Sub (ubuntu-latest, 3.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 3.0, 2.3, ruby)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@byroot
Copy link
Member

byroot commented Mar 30, 2020

Thanks a lot!

@supercaracal supercaracal deleted the supercaracal:fix-a-unstable-test-case branch Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.