gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain5d144817Merge branch 'records-t40' into mainTicketsmain/reports/019-deflake-unliked.md

3.4 KB

  1. # Report 019 — "B: unliked" de-flaked (worker N2, branch w28-deflake)
  2. **Verdict: a TEST flake, not an app bug. Fix: tests/browser.mjs only (`calmClick`). No .hl, no components change, no patch for the Comments block.**
  3. ## 1. Reproduction
  4. The machine was heavily loaded (load 50–70 from other workers; once my own CPU burners, which Atlas had stopped — I won't repeat that).
  5. - Plain gate on f83d9c0, natural load: 12 runs → 1 failure (`delete` → `comment-ask` never appeared), 11 passes; 1 more run earlier passed.
  6. Counting the first runs with instrumentation: base 1–12.
  7. - Under artificial CPU load (36 `yes`, now gone): load 1–8 → 4 failures; load2 1–3 → 1 failure. Failures were always a lost click in the
  8. comments section: **B: unliked** (1×), **A: the edit editor holds the comment** (2× — the Edit click lost), **delete → comment-delete/Keep** (2×),
  9. `comment-ask` missing (2×). "B: unliked" itself failed 1× in ~23 instrumented runs; the other clicks are the same flake.
  10. - State at the "B: unliked" failure (a MutationObserver + capture listeners on B, installed just before the click): button node the SAME
  11. element, aria-pressed 'true', text '♥ 1', **no mousedown/mouseup/click event reached the like button**, and the API still said likes = 1.
  12. So: not stuck by a stale push, not replaced, not a second toggle lost on the server — the press never hit the button. The log showed
  13. DOM mutations still arriving in the 12–13 ms after the press (the push of the first like re-draws the comment: the read-only MdEditor
  14. builds its text a moment after, shifting the buttons below it).
  15. ## 2. Decision
  16. `b.click()` measures the button's box and then sends mouseMoved / mousePressed / mouseReleased in separate CDP calls; when the comment is
  17. re-drawn in between (after every push — more so under load), the press lands where the button was. The wait before the click (`B: liked`,
  18. the `♥ 1` check, the API call) only proves the state, not that the layout has settled. Server toggle, push order and the block's rows are right
  19. (likes 1 → 0 verified in 8 clean runs; one toggle per click, one push per toggle, rows keyed by id). A human cannot hit this: the window is
  20. milliseconds and she sees the button move. (Side note, not a bug I touched: the read-only editor drawing a moment after a push causes a
  21. small layout shift — a polish item for the Comments/MdEditor owner, not a defect of this check.)
  22. ## 3. Fix and proof
  23. tests/browser.mjs: `calmClick(page, sel)` waits until the element's rect has not changed for 8 samples (60 ms interval ≈ half a second),
  24. then does the real click. Used for every button click of the m016 block that follows a push or a re-draw: like ×3, edit-start, save,
  25. delete ×2, keep, delete-yes. Diff: one helper + 9 call sites in tests/browser.mjs, nothing else.
  26. - Before (f83d9c0, natural + loaded): see section 1, 4–5 of ~12 gate runs under load lost a comments click; 1/12 unloaded.
  27. - After: browser gate **351 passed, 0 failed × 8 runs** (the load had dropped to 6–9 while these ran, so they are less demanding than the
  28. loaded "before" runs — I was told not to stress the machine again; a rerun under natural load is the real confirmation);
  29. tests/events.mjs **52 passed, 0 failed**.
  30. - Ports: 8732–8739 only; at the end nothing of mine listens (ss checked); a leftover ident and the orphaned server/Chromes of a killed run were
  31. stopped by PID.
  32. Logs: /media/STORAGE/claude-scratch/atlas/N2/logs/ (base-*, load-*, load2-*, after-*, events.log); instrumentation scripts instr*.py there.

Branches

Latest commits

  • 5d144817Merge branch 'records-t40' into mainTickets
  • 44ee6f06|||PR records: #43 #45 livemre
  • b8fdeee9Merge branch 'p39-routes' into mainTickets
  • a0187a0a|||PR Remove redundant route-order loopmre
  • 369e4b9cMerge branch 'k40-lists' into mainTickets
  • 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
  • 610d8e8aMerge branch 'records-t39' into mainTickets
  • 32bcdf24|||PR records: GO P39 K40mre
  • 4123c6d1Merge branch 'records-t38' into mainTickets
  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre