Repository navigation
Lint Playwright specs and refuse thread::sleep in Rust - #445
Merged
Merged
Conversation
…y rules Replace fixed waits with animationsFinished and a named quietFor, make reads web-first assertions, reopen through about:blank after a restart, and bound one e2e test's size with a baseline that only shrinks.
… name the e2e sleep helpers Split quietFor into quietFor, compositorPresents and measureFor, wait for state at two sites that were waiting on time, and document the lint in the testing guide and CONTRIBUTING.
…h rest wait into a helper
… stale, refresh the size baselines
…tion, drop the three baseline entries it removed
…aywright), lock regenerated by pnpm
HyunjunJeon
pushed a commit
to HyunjunJeon/hide
that referenced
this pull request
Nov 9, 2026
…ore (with-hide#2149) Closes with-hide/hide-private#561 Closes with-hide/hide-private#495 Closes with-hide/hide-private#564 Closes with-hide/hide-private#605 ## Summary e2e 픽스처가 두 번째 에이전트를 너무 일찍 시작해서, 코어가 "다른 시작이 아직 진행 중"이라며 거절하고 픽스처는 30초를 기다리다 실패했습니다. 코어는 시작 하나가 끝나기 전에는 새 시작을 받지 않는데, 첫 에이전트의 행은 그 시작이 끝나기 전에 먼저 보입니다. 이제 테스트는 행이 아니라 코어가 그 시작에 준 답(시작 패널이 읽는 것과 같은 영수증, `task_operation`)을 기다렸다가 다음 시작을 보냅니다. 거절되면 30초를 기다리지 않고 코어의 이유로 바로 실패합니다. 화면 변경 없음: 테스트 코드와 문서만 바뀝니다. ## Review - **조심해서 볼 파일**: `web/e2e/daemon-actions.ts` `startAgentInCheckout` - 코어의 task slot 규칙(`herdr-core/src/runtime/session.rs:3994-4003`)을 그대로 읽는지, `started` 외의 답은 모두 실패로 끝나는지. - **조심해서 볼 파일**: `web/e2e/engine-fixture.ts` - 첫 시작이 끝난 뒤에야 두 번째 시작(또는 family의 spawn)이 나갑니다. 기다림은 코어 신호뿐이고 timeout·sleep·retry는 늘리지 않았습니다. - **원인이 다른 것**: with-hide#444 with-hide#445 with-hide#459 with-hide#479 with-hide#496 은 픽스처가 아니라 spec 안의 기다림에서 실패하고 로그에 거절이 없어 이 PR에서 다루지 않습니다. - **Herdr 레인에서만 난 것**: with-hide#260 with-hide#489 with-hide#502 with-hide#510 with-hide#511 with-hide#519 with-hide#533 은 `*-herdr-*` 레인에서만 났고 그 레인은 #2069로 지워졌습니다. #2069와 아래 반복 run을 적은 댓글로 닫습니다. - **열어 두는 것**: with-hide#490 with-hide#492 with-hide#523 with-hide#529 with-hide#532(`agent_pane_required`)는 이 PR이 끝내지 않습니다. 원인은 with-hide/hide-private#630에서 따로 다룹니다. ## Evidence - **확인한 것**: own engine으로 바뀐 뒤 "second fixture agent" 실패 6건 중 5건(#561 x2, with-hide#495, with-hide#564, with-hide#605; Linux·Windows)의 setup snapshot과 hided 로그를 봤습니다. 모두 두 번째 시작의 request id로 `task_operation.busy` 거절이 남아 있습니다. 나머지 1건(#561, run 42076071271)은 로그를 받지 않았고 오류 줄만 같습니다. - **확인한 것**: 실패 로그 순서는 tab.create 완료 -> busy 거절 -> 첫 시작의 `agent.started`, 통과한 실행은 tab.create 몇 ms 뒤 `agent.started` -> 두 번째 시작입니다. - **확인한 것**: `web`·`desktop` typecheck, lint(e2e 크기 검사 포함) 통과. - **확인한 것**: a79a97b, run 42202678411의 Linux 전체 e2e(6 shard)와 Windows `@platform` e2e를 3번 돌렸습니다. 닫는 11개 제목은 매번 통과했고 재시도도 없었습니다. - attempt 1: Linux 6/6, Windows 1/1 통과. 재시도 후 통과: `desk-lane` "Desk is off on a new install"(Linux 4/6), with-hide#444 close-subtree(Linux 6/6) - attempt 2: Linux 6/6, Windows 1/1 통과, 재시도 없음 - attempt 3: Linux 6/6, Windows 1/1 통과. 재시도 후 통과: `desk-lane` 같은 테스트(Linux 4/6) - **범위 밖**: #444가 attempt 1에서 재시도 후 통과한 것과 `desk-lane`이 두 번 재시도 후 통과한 것은 픽스처 원인이 아닙니다. 이 노드 범위 밖이고 따로 묶여 있습니다. - **확인하지 못한 것**: 로컬 e2e는 돌리지 않았습니다(Rust debug 빌드 디스크 부족). macOS 웹 e2e는 PR CI에 없어 반복하지 않았고, 이 묶음의 21개 이슈 중 macOS에서 난 것은 없습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #433 (retried interactions), #437 (Rust sleeps), #430 (guide), #434 (clock injection and Rust waits), #429 (headless renderer), #438 (shared gate), #419 (retries)
Summary
Playwright specs in
web/e2eanddesktop/e2enow passeslint-plugin-playwrightplus two repository rules, an e2e test size budget runs in the samelintscript, and clippy refusesstd::thread::sleepin Rust.All of it runs in the existing lanes (
web lint,desktop lint,clippy); no new job or workflow step.Existing violations were fixed where a state exists to wait for, and the rest carry a reasoned allow, listed below.
Review
quietForis the only sleep an e2e spec may use for a window in which something must not happen; its 30 call sites each state the claim. Is a time window the right form for those, or should some become a counted check?no-conditional-in-test(98 hits, mostlyprocess.platformand fold toggles) andmax-expects(2409 hits at the default of 5) are not enabled; the size budget replacesmax-expects. Enable either?web/eslint-rules/hide-e2e.mjs- two hand-written rules;web/scripts/check-e2e-test-size.mjs- the baseline logic;web/e2e/wait.ts- the oneeslint-disableforwaitForTimeout.web/e2e/s3.spec.ts(two draft recovery tests) - they must not reload the page, so they carry a line allow with the reason; addingabout:blankmade both fail.web/e2e/theme.spec.ts-networkidlereplaced by asserting hided's empty 404 for/gallery;web/e2e/agent-tab-groups.spec.ts- a 300 ms sleep between twotab focuscalls was removed (the CLI returns after Herdr applied it, events reach the core in order; a probe showed the first focus changes nothing visible);web/e2e/s3.spec.ts- the offline window now also asserts the file was not written.#437allows on the five functions it fixed (hide-ai/src/router.rsx3,usage.rs,live.rs).Evidence
pnpm lintinwebanddesktoppass (ESLint plus the size budget);cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --checkpass;scripts/tests108 pass; the identity and attribution checks pass.waitForTimeout, an action insidetoPass,gotoof#token=afterrestart()); the size budget fails when a baselined test grows (it caught this branch's own 9-line addition to the Overview test, which moved into a helper).hidedand the pinned Herdr, all pass: theme (gallery and restart), start-panel, agent-tab-groups external focus, sidebar-pr-start, cmdk recents, both s3 draft recovery tests, s6 Main/Overview (failed once on the first run at the File Views open, passed on the immediate rerun; this PR only relabels a wait in that test), and the Overview graph test.quietFor, native captures withoutcompositorPresents, Rust allows with the wrong reason); all were fixed before this PR.expect.soft(fn).toPass(), a poll that calls an action through a helper, and agotothrough a localurlvariable afterrestart()are not seen; a hand-writtennew Promise((r) => setTimeout(r, ms))is not seen either (mobile.spec x2, remote-workspace, browser, workspace-columns x2 exist today); clippy coversstd::thread::sleeponly, notpark_timeout,wait_timeoutas a delay or a spawnedsleep. Rust tests sleep instead of waiting for a state or injecting the clock #437 lists the Rust gap.cfg(windows)or Linux-only code, which is how the two Windows named-pipe waits inhide-platform/src/ipc.rsslipped through (found by the Windows OS contract job). A source scan of everysleep(call in the tree, regardless of cfg, now finds none outside an allowed function; a Windows-target clippy run reachedhide-platformandhide-aibeforeringfailed to build on this Mac, so the Windows lane in CI is the check for the rest.Instant::nowandSystemTime::nowbans in clock-injected modules. Clippy cannot scope a method to a module and Make Rust tests wait on state instead of a wall-clock guess #434 has injected no module yet; once it has, a per-crateclippy.tomlor a module-leveldenywith those two methods is the follow-up.Sleeps and waits, before and after
waitForTimeoutinweb/e2eanddesktop/e2eweb/e2e/wait.ts, behind three named helpers)quietFor: a window in which something must not happencompositorPresents: native capture on macOSmeasureFor: idle measurement and sample pacinganimationsFinished: waits for finite animations, not timeunchangedForFrames: waits until a value stops changing for 30 animation frames (bounded)networkidle, s3 offline window)no-action-in-pollallows, all #433reopen-after-restart-through-blankallows (reconnect is the subject)#[allow(clippy::disallowed_methods)])The production waits are allowed line by line rather than by a crate-root allow with
denyin test modules: that form would leave every newmod testsandtests/*.rsfile unguarded until someone adds the attribute, whereas the line allows fail closed.Size budget
web/e2e/test-size-baseline.json(20 tests; #447 split three of them) anddesktop/e2e/test-size-baseline.json(13) record the tests over 120 lines or 40expectcalls as a ceiling that only shrinks.Pending guide sentences
docs/TESTING.mdnames #429, #438 and #434 as pending, and #419 for retries and nextest; each of those pull requests fixes its own sentence when it takes main.Verification record
Base
origin/main4df25a0. Local runs:pnpm lint(web, desktop),scripts/verify-cargo.sh clippy --workspace --all-targets -- -D warnings,fmt-check,python3 -m unittest discover -s scripts/tests, Playwright specs listed above. Review by a separate reviewer: see the PR comments.Main merge (#434, #435, #431, #450): baselines were refreshed after it. Two
browser-cdp.spec.tstests added by main were already over the budget and are baselined (172 and 121 lines); the Overview test grew 9 lines on main and its ceiling moved with it. Rust allows: 123 in total after the merge.