diff options
author | mbeierl <mark.beierl@dell.com> | 2017-01-20 12:25:19 -0500 |
---|---|---|
committer | mbeierl <mark.beierl@dell.com> | 2017-01-20 13:40:23 -0500 |
commit | 37773383c0ea27a934b9e97788e07276cbaaadcf (patch) | |
tree | 647a677ba3de14efc65b092a517be600554d1466 | |
parent | 60d167b3a572b705dfdc9421802099eddad2307f (diff) |
Correct duplicate event notification
Clears the listener list on start and remove listener after run
is completed.
Change-Id: I76e1f13379d60bdb72fcf2faf57d9762a62f17d3
JIRA: STORPERF-96
Signed-off-by: mbeierl <mark.beierl@dell.com>
-rw-r--r-- | storperf/test_executor.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/storperf/test_executor.py b/storperf/test_executor.py index 8350e43..9c9393f 100644 --- a/storperf/test_executor.py +++ b/storperf/test_executor.py @@ -105,6 +105,8 @@ class TestExecutor(object): def broadcast_event(self): for event_listener in self.event_listeners: try: + self.logger.debug("Notifying event listener %s", + event_listener) event_listener(self) except Exception, e: self.logger.exception("While notifying listener %s", e) @@ -197,6 +199,7 @@ class TestExecutor(object): def execute_workloads(self): self._terminated = False self.logger.info("Starting job %s" % (self.job_db.job_id)) + self.event_listeners.clear() data_handler = DataHandler() self.register(data_handler.data_event) @@ -284,6 +287,7 @@ class TestExecutor(object): self.end_time = time.time() self._terminated = True self.broadcast_event() + self.unregister(data_handler.data_event) def execute_on_node(self, workload): @@ -296,5 +300,6 @@ class TestExecutor(object): self.job_db.start_workload(workload) workload.execute() self.job_db.end_workload(workload) + invoker.unregister(self.event) self.logger.info("Ended " + workload.fullname) |