Files
orca/tests/e2e/typing-scale-census.ts
Jinwoo Hong bdb18003e0 test: add accumulated-workspace terminal typing reproduction (#20934)
* test: reproduce accumulated-workspace typing latency through real PTYs

* test: make the bench harness self-checks falsifiable

Review found four assertions that could not fail and one fixture gap:

- `missingPtyArrivalCount`/`missingEchoCount` were hardcoded `0` and
  `validateExpectedSeqs` throws before them, so every assertion on them
  was vacuous and every report read `0`. The throw is the real guard and
  is already covered; drop the vestigial fields.
- An absent status controller returned an all-zero result, which satisfied
  its own accepted-equals-generated equality. Assert presence first.
- The byte-pacing control had only an upper bound, so a generator emitting
  no stream bytes passed. Add the lower bound.
- `lineageEvery: 1` built zero lineage: no ordinal satisfies
  `% 1 === 1`. Offset the interval and cover the densest setting.
- The documented control command never set ORCA_TYPING_BENCH, so it
  skipped instead of running.
2026-09-16 13:10:46 -04:00

16 lines
572 B
TypeScript

import type { Page } from '@stablyai/playwright-test'
import type {
TypingDiagnosticBridge,
TypingLatencyReport
} from '../../src/renderer/src/lib/typing-latency/diagnostic'
/** Reads the existing census without enabling per-keystroke diagnostic instrumentation. */
export async function readTypingScaleCensus(
page: Page
): Promise<TypingLatencyReport['census'] | null> {
return page.evaluate(() => {
const target: Window & { __orcaTypingDiagnostic?: TypingDiagnosticBridge } = window
return target.__orcaTypingDiagnostic?.report().census ?? null
})
}