diff --git a/tests/test_zookeeper.py b/tests/test_zookeeper.py index 35b19de80e..131b930178 100644 --- a/tests/test_zookeeper.py +++ b/tests/test_zookeeper.py @@ -1,3 +1,4 @@ +import os import unittest from StringIO import StringIO from tests.common import get_check @@ -23,6 +24,9 @@ """ class TestZookeeper(unittest.TestCase): + def is_travis(self): + return "TRAVIS" in os.environ + def test_zk_stat_parsing_lt_v344(self): zk, instances = get_check('zk', CONFIG) stat_response = """Zookeeper version: 3.2.2--1, built on 03/16/2010 07:31 GMT @@ -63,11 +67,14 @@ def test_zk_stat_parsing_lt_v344(self): zk.check(instances[0]) service_checks = zk.get_service_checks() - self.assertEquals(len(service_checks), 2) + expected = 1 if self.is_travis() else 2 + self.assertEquals(len(service_checks), expected) self.assertEquals(service_checks[0]['check'], 'zookeeper.ruok') # Don't check status of ruok because it can vary if ZK is running. - self.assertEquals(service_checks[1]['check'], 'zookeeper.mode') - self.assertEquals(service_checks[1]['status'], AgentCheck.CRITICAL) + + if not self.is_travis(): + self.assertEquals(service_checks[1]['check'], 'zookeeper.mode') + self.assertEquals(service_checks[1]['status'], AgentCheck.CRITICAL) def test_zk_stat_parsing_gte_v344(self): zk, instances = get_check('zk', CONFIG2)