Skip to content

Commit

Permalink
Add tests for nodetool get/settimeout commands
Browse files Browse the repository at this point in the history
Done for CASSANDRA-10953
  • Loading branch information
thobbs committed Jan 6, 2016
1 parent 3e920da commit a9081f5
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions nodetool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,35 @@ def test_correct_dc_rack_in_nodetool_info(self):
rack = "rack{}".format(i % 2)
self.assertTrue(line.endswith(rack),
"Expected rack {} for {} but got {}".format(rack, node.address(), line.rsplit(None, 1)[-1]))

def test_nodetool_timeout_commands(self):
"""
@jira_ticket CASSANDRA-10953
Test that nodetool gettimeout and settimeout work at a basic level
"""
cluster = self.cluster
cluster.populate([1]).start()
node = cluster.nodelist()[0]

types = ('read', 'range', 'write', 'counterwrite', 'cascontention',
'truncate', 'streamingsocket', 'misc')

# read all of the timeouts, make sure we get a sane response
for timeout_type in types:
out, err = node.nodetool('gettimeout %s' % timeout_type)
self.assertEqual(0, len(err), err)
debug(out)
self.assertRegexpMatches(out, r'.* \d+ ms')

# set all of the timeouts to 123
for timeout_type in types:
_, err = node.nodetool('settimeout %s 123' % timeout_type)
self.assertEqual(0, len(err), err)

# verify that they're all reported as 123
for timeout_type in types:
out, err = node.nodetool('gettimeout %s' % timeout_type)
self.assertEqual(0, len(err), err)
debug(out)
self.assertRegexpMatches(out, r'.* 123 ms')

0 comments on commit a9081f5

Please sign in to comment.