diff --git a/ceilometer/tests/api/v2/test_alarm_scenarios.py b/ceilometer/tests/api/v2/test_alarm_scenarios.py index f03416780..c895b1540 100644 --- a/ceilometer/tests/api/v2/test_alarm_scenarios.py +++ b/ceilometer/tests/api/v2/test_alarm_scenarios.py @@ -914,9 +914,14 @@ class TestAlarms(v2.FunctionalTest, status=400, headers=self.auth_headers) alarms = list(self.alarm_conn.get_alarms()) self.assertEqual(7, len(alarms)) - self.assertEqual('threshold_rule and combination_rule cannot ' - 'be set at the same time', - resp.json['error_message']['faultstring']) + + # threshold_rule and combination_rule order is not + # predictable so it is not possible to do an exact match + # here + error_faultstring = resp.json['error_message']['faultstring'] + for expected_string in ['threshold_rule', 'combination_rule', + 'cannot be set at the same time']: + self.assertIn(expected_string, error_faultstring) def test_post_invalid_alarm_timestamp_in_threshold_rule(self): date_time = datetime.datetime(2012, 7, 2, 10, 41) diff --git a/tox.ini b/tox.ini index 9db7fd571..537926853 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,6 @@ install_command = pip install -U {opts} {packages} usedevelop = True setenv = VIRTUAL_ENV={envdir} EVENTLET_NO_GREENDNS=yes - PYTHONHASHSEED=0 commands = bash -x {toxinidir}/setup-test-env-mongodb.sh python setup.py testr --slowest --testr-args="{posargs}" downloadcache = {toxworkdir}/_download @@ -72,12 +71,14 @@ commands = [testenv:docs] commands = python setup.py build_sphinx +setenv = PYTHONHASHSEED=0 [testenv:pylint] commands = bash tools/lintstack.sh [testenv:venv] commands = {posargs} +setenv = PYTHONHASHSEED=0 [testenv:debug] commands = bash -x {toxinidir}/setup-test-env-mongodb.sh oslo_debug_helper {posargs}