diff options
| author | blasty <blasty@local> | 2026-08-07 14:49:33 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-08-07 14:49:33 +0200 |
| commit | 56a9e78b2ad8140cbad6792c7819cc6ac5b27ba0 (patch) | |
| tree | bdc7bec51a7eea2b9d738bd9ca34b6fc8a9fc320 | |
| parent | tests: thumb_ui 5m13s (crashing) -> 8.5s (diff) | |
| download | ida-tui-56a9e78b2ad8140cbad6792c7819cc6ac5b27ba0.tar.gz ida-tui-56a9e78b2ad8140cbad6792c7819cc6ac5b27ba0.tar.xz ida-tui-56a9e78b2ad8140cbad6792c7819cc6ac5b27ba0.zip | |
tests: trace_ui followed a signal that was not one (and it really did fail)
"the code view follows the trace" failed on the port (None vs 0x2ae4) and
passed on master, but it was not a trace regression: the test pressed "]",
waited for `app._t == 1`, and then read the listing cursor. `app._t` is
assigned the moment the key is handled -- the navigation it starts runs in a
worker -- so the wait was satisfied before the view had moved, and the check
read a cursor that had no address yet.
Master won that race because its backend answers in single-digit milliseconds.
The Code Mode backend is slower, so the race became a reliable failure. The
gate is now the condition the check is about (the cursor is on the trace's ip),
for both the forward and the backward step.
39 passed, 0 failed -- the same tally as master.
| -rw-r--r-- | tests/test_trace_ui.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test_trace_ui.py b/tests/test_trace_ui.py index bb016eb..5844c90 100644 --- a/tests/test_trace_ui.py +++ b/tests/test_trace_ui.py @@ -20,6 +20,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from textual.widgets import Input, OptionList, Static # noqa: E402 from _fixtures import staged # noqa: E402 +from idatui._sync import settle # noqa: E402 from idatui.app import (DecompView, IdaTui, ListingView, # noqa: E402 RegWriteScreen, TraceDock) @@ -109,13 +110,20 @@ async def run() -> int: lst.focus() await pilot.pause(0.4) await pilot.press("]") - await wait(lambda: app._t == 1, pilot, 20) + # `app._t` is assigned the moment the key is handled, so it is NOT a + # signal that the VIEW has followed -- the navigation it kicks off + # runs in a worker. Waiting on it and then reading the cursor was a + # race that the (slower) Code Mode backend loses. Gate on the thing + # the check is about. + await settle(app, lambda: app._t == 1 and lst._cursor_ea() == t.ip(1), + timeout=20) check("] steps forward one instruction", app._t == 1, f"t={app._t}") check("the code view follows the trace", lst._cursor_ea() == t.ip(1), f"{lst._cursor_ea()} vs {t.ip(1)}") await pilot.press("[") - await wait(lambda: app._t == 0, pilot, 20) + await settle(app, lambda: app._t == 0 and lst._cursor_ea() == t.ip(0), + timeout=20) check("[ steps backward", app._t == 0, f"t={app._t}") await pilot.press("[") await pilot.pause(0.4) |
