aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Naydanov <109669442+en-sc@users.noreply.github.com>2024-05-16 11:01:31 +0300
committerGitHub <noreply@github.com>2024-05-16 11:01:31 +0300
commit408e461da11e0b298c4b69e587729532787212f5 (patch)
tree7831264ec717f5be689f23ce50755d84b839494f
parentd3b582ef65264b0a7404103ca35144ae36d3bdfe (diff)
parentdb7e451c49fc8a3d45929c832a9b606f5deb7899 (diff)
downloadriscv-tests-408e461da11e0b298c4b69e587729532787212f5.zip
riscv-tests-408e461da11e0b298c4b69e587729532787212f5.tar.gz
riscv-tests-408e461da11e0b298c4b69e587729532787212f5.tar.bz2
Merge pull request #555 from aap-sc/aap-sc/sporadic_faulure_fix
debug: workaround for sporadic failures of some tests due to unexpected data present in pexpect match
-rw-r--r--debug/testlib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/debug/testlib.py b/debug/testlib.py
index d4826bb..1f107be 100644
--- a/debug/testlib.py
+++ b/debug/testlib.py
@@ -367,10 +367,15 @@ class Openocd:
self.tclrpc_port = None
self.start(cmd, logfile, extra_env)
- self.openocd_cli = pexpect.spawn(f"nc localhost {self.tclrpc_port}")
+ self.openocd_cli = pexpect.spawn(f"nc localhost {self.tclrpc_port}",
+ echo=False)
# TCL-RPC uses \x1a as a watermark for end of message. We set raw
# pty mode to disable translation of \x1a to EOF
tty.setraw(self.openocd_cli.child_fd)
+ hello_string = self.command(
+ "capture { echo \"Hello TCL-RPC!\" }").decode()
+ if not "Hello TCL-RPC!" in hello_string:
+ raise RuntimeError(f"TCL-RPC - unexpected reply:\n{hello_string}")
def start(self, cmd, logfile, extra_env):
combined_env = {**os.environ, **extra_env}