Fix netstats_test to accept "Connection refused" messages pre- and post-Java 1.8u111
Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/cf216319 Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/cf216319 Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/cf216319 Branch: refs/heads/master Commit: cf2163198d1dee1339ee2d771d8a426e7dc3eb9d Parents: c6e6a4e Author: Joel Knighton <[email protected]> Authored: Mon Mar 13 11:51:15 2017 -0500 Committer: Joel Knighton <[email protected]> Committed: Wed Mar 15 11:50:33 2017 -0500 ---------------------------------------------------------------------- jmx_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/cf216319/jmx_test.py ---------------------------------------------------------------------- diff --git a/jmx_test.py b/jmx_test.py index ec817b9..7251b12 100644 --- a/jmx_test.py +++ b/jmx_test.py @@ -28,7 +28,7 @@ class TestJMX(Tester): node1.flush() node1.stop(gently=False) - with self.assertRaisesRegexp(ToolError, "ConnectException: 'Connection refused'."): + with self.assertRaisesRegexp(ToolError, "ConnectException: 'Connection refused( \(Connection refused\))?'."): node1.nodetool('netstats') # don't wait; we're testing for when nodetool is called on a node mid-startup @@ -48,7 +48,7 @@ class TestJMX(Tester): if not isinstance(e, ToolError): raise else: - self.assertIn("ConnectException: 'Connection refused'.", str(e)) + self.assertRegexpMatches(str(e), "ConnectException: 'Connection refused( \(Connection refused\))?'.") self.assertTrue(running, msg='node1 never started') --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
