From 3c9bdc9ce4d65c26c6412ccfb6ba4e713690e0db Mon Sep 17 00:00:00 2001 From: Shaanjot Gill Date: Tue, 28 Feb 2023 08:32:59 -0800 Subject: [PATCH] performance demo fix Signed-off-by: Shaanjot Gill --- demo/runners/performance.py | 12 ++++++++++-- demo/runners/support/agent.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/demo/runners/performance.py b/demo/runners/performance.py index 02b6d3283e..4c79bf6437 100644 --- a/demo/runners/performance.py +++ b/demo/runners/performance.py @@ -108,7 +108,15 @@ async def check_received_creds(self) -> Tuple[int, int]: pending = 0 total = len(self.credential_state) for result in self.credential_state.values(): - if result != "done" and result != "credential_acked": + # Since cred_ex_record is set to be auto-removed + # the state in self.credential_state for completed + # exchanges will be deleted. Any problematic + # exchanges will be in abandoned state. + if ( + result != "done" + and result != "deleted" + and result != "credential_acked" + ): pending += 1 if self.credential_event.is_set(): continue @@ -422,7 +430,7 @@ async def check_received_creds(agent, issue_count, pb): pending, total = await agent.check_received_creds() complete = total - pending if reported == complete: - await asyncio.wait_for(agent.update_creds(), 30) + await asyncio.wait_for(agent.update_creds(), 45) continue if iter_pb and complete > reported: try: diff --git a/demo/runners/support/agent.py b/demo/runners/support/agent.py index 1ec42565dc..0aa7f995ed 100644 --- a/demo/runners/support/agent.py +++ b/demo/runners/support/agent.py @@ -724,7 +724,7 @@ def _terminate(self): if self.proc and self.proc.poll() is None: self.proc.terminate() try: - self.proc.wait(timeout=0.5) + self.proc.wait(timeout=1.5) self.log(f"Exited with return code {self.proc.returncode}") except subprocess.TimeoutExpired: msg = "Process did not terminate in time"