Skip to content
Snippets Groups Projects
Commit 4875e79a authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Testbench diagnostics

parent f17deb53
No related branches found
No related tags found
1 merge request!188Testbench improvements and WIP alignment scenario
...@@ -69,7 +69,10 @@ class DimService: ...@@ -69,7 +69,10 @@ class DimService:
def callback(timestamp, tag, value): def callback(timestamp, tag, value):
assert tag == self._tag assert tag == self._tag
if isinstance(value, str): if isinstance(value, str):
assert value[-1] == "\0" if not value[-1] == "\0":
msg = f"Unexpected DIM response {value!r}"
log.fatal(msg)
raise RuntimeError(msg)
value = value[:-1] value = value[:-1]
log.debug(f"{self._name}: callback got {value!r}") log.debug(f"{self._name}: callback got {value!r}")
self._queue.put_nowait((timestamp, value)) self._queue.put_nowait((timestamp, value))
......
...@@ -289,8 +289,9 @@ async def tasks_wait_for_status(tasks, status, *, skip=[], utgid=None): ...@@ -289,8 +289,9 @@ async def tasks_wait_for_status(tasks, status, *, skip=[], utgid=None):
st = await t.status() st = await t.status()
statuses[t.utgid] = st statuses[t.utgid] = st
if not all(s == status for s in statuses.values()): if not all(s == status for s in statuses.values()):
log.error(f"Unexpected statuses: {statuses}") message = f"Unexpected statuses: {statuses}"
raise RuntimeError(f"Unexpected statuses: {statuses}") log.error(message)
raise RuntimeError(message)
async def tasks_wait_for_exit(tasks): async def tasks_wait_for_exit(tasks):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment