Skip to content

Commit

Permalink
handling clean up errors in test
Browse files Browse the repository at this point in the history
  • Loading branch information
schandrika committed Apr 16, 2024
1 parent 859dbe8 commit 2f5f652
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
3 changes: 0 additions & 3 deletions volttron/platform/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,6 @@ def issue(self, topic, frames, extra=None):
# return result

def handle_subsystem(self, frames, user_id):
# _log.debug(
# f"Handling subsystem with frames: {frames} user_id: {user_id}")

subsystem = frames[5]
if subsystem == 'quit':
sender = frames[0]
Expand Down
25 changes: 14 additions & 11 deletions volttrontesting/utils/platformwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,17 +1564,20 @@ def shutdown_platform(self):
return

running_pids = []
if self.dynamic_agent: # because we are not creating dynamic agent in setupmode
for agnt in self.list_agents():
pid = self.agent_pid(agnt['uuid'])
if pid is not None and int(pid) > 0:
running_pids.append(int(pid))
if not self.skip_cleanup:
self.remove_all_agents()
# don't wait indefinetly as shutdown will not throw an error if RMQ is down/has cert errors
self.dynamic_agent.vip.rpc(CONTROL, 'shutdown').get(timeout=10)
self.dynamic_agent.core.stop()
self.dynamic_agent = None
if self.dynamic_agent:
try:# because we are not creating dynamic agent in setupmode
for agnt in self.list_agents():
pid = self.agent_pid(agnt['uuid'])
if pid is not None and int(pid) > 0:
running_pids.append(int(pid))
if not self.skip_cleanup:
self.remove_all_agents()
# don't wait indefinetly as shutdown will not throw an error if RMQ is down/has cert errors
self.dynamic_agent.vip.rpc(CONTROL, 'shutdown').get(timeout=10)
self.dynamic_agent.core.stop()
self.dynamic_agent = None
except BaseException as e:
self.logit(f"Exception while shutting down. {e}")

if self.p_process is not None:
try:
Expand Down

0 comments on commit 2f5f652

Please sign in to comment.