Permalink
Browse files

Fix hashing id in sensor test

  • Loading branch information...
1 parent bae1064 commit b6c77a56740c3cba5445245f98de7ae17953d150 @oldpatricka oldpatricka committed Nov 28, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 ion/agents/cei/test/test_haagent.py
@@ -2,6 +2,7 @@
import functools
import BaseHTTPServer
import socket
+import md5
from BaseHTTPServer import HTTPServer
from random import randint
@@ -412,7 +413,7 @@ def setUp(self):
'metric': 'app_attributes:ml',
'sample_period': 600,
'sample_function': 'Average',
- 'cooldown_period': 20,
+ 'cooldown_period': 5,
'scale_up_threshold': 2.0,
'scale_up_n_processes': 1,
'scale_down_threshold': 1.0,
@@ -506,7 +507,7 @@ def test_sensor_policy(self):
upids = self._get_managed_upids()
response = ""
for upid in upids:
- response += "%s,ml=5\n"
+ response += "%s,ml=5\n" % md5.new(upid).hexdigest()
self._set_response(response)
self.waiter.await_state_event(state=ProcessStateEnum.RUNNING)
@@ -517,7 +518,7 @@ def test_sensor_policy(self):
upids = self._get_managed_upids()
response = ""
for upid in upids:
- response += "%s,ml=1.5\n"
+ response += "%s,ml=1.5\n" % md5.new(upid).hexdigest()
self._set_response(response)
self.assertEqual(len(self.get_running_procs()), 2)
@@ -536,7 +537,7 @@ def test_sensor_policy(self):
upids = self._get_managed_upids()
response = ""
for upid in upids:
- response += "%s,ml=0.5\n"
+ response += "%s,ml=0.5\n" % md5.new(upid).hexdigest()
self._set_response(response)
self.waiter.await_state_event(state=ProcessStateEnum.TERMINATED)

0 comments on commit b6c77a5

Please sign in to comment.