diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-24 12:32:57 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-24 14:38:26 -0300 |
| commit | a19eb53fa9ade764a1cf2e3c320cd34d50aa4106 (patch) | |
| tree | 2ee06ffb71737f3d481d3af85fc390c12b38a929 /test/daemon.py | |
| parent | 4ce902f94800a00b2b39de91ed61d0c5b32db271 (diff) | |
| download | pardes-a19eb53fa9ade764a1cf2e3c320cd34d50aa4106.tar.gz pardes-a19eb53fa9ade764a1cf2e3c320cd34d50aa4106.zip | |
gui: an SDL assertion in a pardes window is logged once with its words and gone on from, never SDL's dialog (sdlAssertion, set in runNative before SDL's first call: every window of pardes, the session's, a client's, the pair's, starts there; a test build fails at one), and a frame's clips are held to the target where sketchbook sets them (sketchbook soynqook: Cells.onTarget; scrollScissor's own clamps to the target go, imageScissor's clip is the placement's cells): the hunt's client window met SDL_SetGPUScissor's release assertion ('Scissor rectangle size exceeds current render target dimensions', 1 and 215 times in 30 sizes: its view's frame drawn at the session window's size into its own smaller target, item 2's cause) and SDL's default handler put up a dialog (zenity) that blocked the window's thread: the window stuck at 918x610 through 30 sizes, its last frame cut, nothing opened after shown (the user's "contents got cut (and panes didn't open)"); a terminal client has no SDL and no dialog: the same shape there is a panic, which runtime/main.zig's handler records and the terminal is put back (no-panic-2); RUN on a throwaway whose picture clips run 100000 px past any target (a PDF window client of a terminal's session, the test surface's capture target): without the hold SDL's assertion 86 times, logged once by pardes ("SDL assertion: !\"Scissor rectangle size exceeds current render target dimensions\" at SDL_gpu.c:1984 (SDL_SetGPUScissor_REAL); ignored, from now on"), the client going on to the test's end (its wheel, page 4, digests agreed); with the hold none; --client-resize-real counts pardes's line as an assertion too: 0, 14 inputs besides 22 pointer motions, 20 rollbacks; the real-window test keeps its windows away: driftwm places a window again when it maps, after the test's first move (a window came back beside the user's view about 1 s after it was moved, and stayed there for the run): `away()` moves it until it stays 2 s, else fails
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/daemon.py')
| -rw-r--r-- | test/daemon.py | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/test/daemon.py b/test/daemon.py index 06458ff4..5603131d 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -2309,6 +2309,23 @@ def client_resize_real(binary, gui_binary): state = drift('state')['Ok']['State'] return next((w for w in state['windows'] if w.get('pid') == pid), None) + def away(pid, x, y): + """The window moved far from the desktop user's view, and kept + there: driftwm places a window again when it maps, after a move made + before (it came back beside the user's view, 2026-11-24).""" + wid = window_of(pid)['id'] + still = 0 + for _ in range(300): + if window_of(pid)['position'] != [x, y]: + drift('move', '--id', wid, x, y) + still = 0 + else: + still += 1 + if still == 40: + return wid + time.sleep(0.05) + raise AssertionError(('a test window would not stay away from the desktop user\'s view', window_of(pid))) + scratch = Path(__file__).resolve().parent.parent.parent / '.scratch' / 'daemon' / 'dmn' scratch.mkdir(parents=True, exist_ok=True) root = Path(tempfile.mkdtemp(prefix='cr-', dir=os.environ.get('TMPDIR') or scratch)) @@ -2333,8 +2350,8 @@ def client_resize_real(binary, gui_binary): cwd=root, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=open(root / 's.err', 'w'), start_new_session=True) started.append(sess.pid) - sid = wait_for('the session\'s window', lambda: (window_of(sess.pid) or {}).get('id'), timeout=30) - drift('move', '--id', sid, 59400, -18000) + wait_for('the session\'s window', lambda: (window_of(sess.pid) or {}).get('id'), timeout=30) + away(sess.pid, 59400, -18000) if focused is not None: drift('focus', '--id', focused) sock = root / 'pardes-replica.sock' @@ -2357,9 +2374,9 @@ def client_resize_real(binary, gui_binary): PARDES_REPLICA_STATS=str(stats), SDL_EVENT_LOGGING='2'), cwd=root, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=open(err, 'w'), start_new_session=True) started.append(w.pid) - wid = wait_for('the client\'s window', lambda: (window_of(w.pid) or {}).get('id'), timeout=30) + wait_for('the client\'s window', lambda: (window_of(w.pid) or {}).get('id'), timeout=30) # Far from where the desktop's user looks, the focus given back. - drift('move', '--id', wid, 62000, -18000) + wid = away(w.pid, 62000, -18000) if focused is not None: drift('focus', '--id', focused) time.sleep(3) @@ -2376,7 +2393,8 @@ def client_resize_real(binary, gui_binary): w.wait(timeout=15) line = checks(stats)[-1].split() if checks(stats) else [] sent = int(line[line.index('inputs') + 1]) if 'inputs' in line else -1 - asserted = said.count('Assertion failure') + # SDL's default handler's words, and pardes's own (gui.zig sdlAssertion). + asserted = said.count('Assertion failure') + said.count('SDL assertion: ') # A pointer that crossed the window (one sliding under it as it was # moved away) is motion's, --client-motion's: not counted here. motions = said.count('SDL_EVENT_MOUSE_MOTION') |
