Repository navigation
test(notebook): trace escape before keymap dispatch - #135
BartvHelvert wants to merge 2 commits into
Conversation
Diagnostics for #113, not a fix. `SplitModeNotebookTest > the strip between cells adds a code or markdown cell there` still fails on CI: the new markdown cell's Escape leaves it unrendered, last observed `[# Top, one, mid, two]`. Ten runs of an earlier trace on each of two commits answered the first question. In all five failures the key reached neither IDE: no `pressed ESCAPE` in either process's dispatcher, no popup open, no drag, and a thread dump taken during the stall with the client's EDT parked in `getNextEvent`. The Escape is not taken by something in the client; it never arrives. The tests keep tracing `IdeKeyEventDispatcher`, which logs each key's candidate actions and the one chosen, so a key that does arrive is still told from one that is taken on the way. Around the Escape the test now also records, on the client: whether the cell's editor is still the focus owner, whether the frame is focused, whether the robot has the input focus -- the window manager's, which Xvfb has none to give, and which the frame's own `isFocused` does not tell -- and where the pointer rests, since an X server with no focused window gives keys to the window under it. They are printed and put in the failure message, as the popup already is, and none of them can fail the test they report on. The next failure then separates a key the robot had nowhere to send from one the X server dropped. Refs #113
cc073d0 to
f95c92a
Compare
The input-events robot posts into the IDE queue, and its input-focus probe injects another key. Observe posting, dispatch, callback results, and consumption directly, with passive focus diagnostics and a single Escape assertion. Check observer behavior and hook installation. Add an opt-in CI batch that repeats the full notebook class ten times on each OS and retains successful runs' logs for comparison. Refs #113
|
Closing: the question this branch was built to answer is answered, and the agent is no longer the Where it got to. The diagnostics here ruled out every candidate in turn — the key reached The answer, derived from the platform's own bytecode and registry defaults and written up Why not run the agent again. It instruments The runs are better spent on whether the fix holds. #152 presses again until the key arrives, and The branch stays reachable if the agent is ever wanted again — as does |
What this changes
Diagnostics for #113. A new notebook markdown cell occasionally stays in edit mode after one Escape, with
[# Top, one, mid, two]still visible. The assertion still requires that single Escape to render it; no key retry or notebook behavior change is added.What the previous runs establish
The latest ten repeats at
f95c92a0had two notebook failures, both on Ubuntu. Both reportedpopup active=false, and cell/frame/input focustruebefore and after Escape. Neither IDE loggedpressed ESCAPEinIdeKeyEventDispatcher's action trace. Earlier batches also reproduced on Windows.That trace is downstream of queue processing and early consumers. Its absence does not establish that no event entered the JVM or reached the key dispatcher.
The tests set
driver.robot.use.input.events=true:InputEventsRobotposts directly intoIdeEventQueue. Moreover,hasInputFocus()injects a probe key and compares the queue's posted-key counter. It is not a passive OS-focus observation in this mode. These results do not establish an Xvfb/window-manager or pointer-routing problem. The input-focus probe and pointer diagnostics are removed; guarded passive cell/frame focus and popup reads remain.The next trace
With
-PtraceEscape=true, a test-only Java agent observes the pinned IDE using JDK instrumentation/class-file APIs:ESCAPE_TRACElines include process/thread, event identity, event type/time, target component, current focus owner, and consumed state. Callbacks run once and their result/exception paths are preserved. The observer never posts, consumes, or redispatches an event. Hook installation is checked before the markdown cell is created, so a missing robot hook cannot look like an unposted Escape.The agent and its small bootstrap-visible observer ship only as test tooling. No plugin code is changed.
Repeating the original sequence
The existing CI workflow has an opt-in
notebook_escapedispatch input. It runs the wholeSplitModeNotebookTestclass ten times on each of Ubuntu and Windows, in fresh jobs. Each class keeps its existing scenario order and shared IDE sessions. It enables the agent, runs its observer checks, and retains IDE logs for successful runs too. Ordinary PR job names and sharding are preserved.How it was tested
:ui-test:verifyEscapeTraceAgentpasses, including checks against the pinned IDE and a plugin resource loader that hides JDK resources.:ui-test:test --tests '*SplitModeNotebookTest' -PtraceEscape=true -PsearchableOptions=falsepasses locally: all 16 tests, including three strip-insertion rounds; all four hooks installed and no observer errors. Each markdown cell rendered after one Escape.freshTestrun finished successfully: 1,512 passed, zero failures, two optional integration tests skipped. No further local runs were started after CI was requested.actionlintpasses for the workflow (ShellCheck unavailable locally).1b863518, ten complete notebook-class runs per OS. Results pending.Checklist
A new feature has a UI test.Diagnostics in the existing notebook UI test; agent behavior has dedicated checks.No product behavior change.docs/is updated where behaviour changed,docs/status.mdespecially.Third-party material keeps its notice and is listed inNone added.NOTICE.md.