mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
test: measure idle and interaction frame scheduling in SSH freeze repro
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Docker SSH freeze distribution diagnostic
|
||||
name: Docker SSH frame scheduling diagnostic
|
||||
on:
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
@@ -21,10 +21,10 @@ jobs:
|
||||
pnpm run build:relay
|
||||
pnpm exec electron-vite build --mode e2e
|
||||
- name: Measure existing freeze oracle distribution
|
||||
run: xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env SKIP_BUILD=1 ORCA_E2E_SSH_DOCKER=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-docker-bulk-open-freeze-repro.spec.ts --project=electron-headless --workers=1 --repeat-each=10
|
||||
run: xvfb-run --auto-servernum bash .github/scripts/e2e-with-window-manager.sh env SKIP_BUILD=1 ORCA_E2E_SSH_DOCKER=1 ORCA_E2E_FORWARD_APP_LOGS=1 pnpm exec playwright test --config tests/playwright.config.ts tests/e2e/ssh-docker-bulk-open-freeze-repro.spec.ts --project=electron-headless --workers=1 --repeat-each=3
|
||||
- uses: actions/upload-artifact@v7
|
||||
if: failure()
|
||||
with:
|
||||
name: freeze-distribution-traces
|
||||
name: freeze-frame-control-traces
|
||||
path: test-results/
|
||||
retention-days: 3
|
||||
|
||||
@@ -83,6 +83,9 @@ test.describe('R2 Docker SSH bulk-open freeze', () => {
|
||||
registerPostElectronShutdownCleanup
|
||||
}, testInfo) => {
|
||||
test.setTimeout(420_000)
|
||||
orcaPage.on('console', (message) => {
|
||||
if (message.text().startsWith('[freeze-frame-control interaction]')) console.log(message.text())
|
||||
})
|
||||
let target: DockerSshRelayTarget | null = null
|
||||
try {
|
||||
target = startDockerSshRelayTarget(testInfo)
|
||||
@@ -100,6 +103,19 @@ test.describe('R2 Docker SSH bulk-open freeze', () => {
|
||||
remotePath: DOCKER_SSH_RELAY_REMOTE_REPO_PATH
|
||||
})
|
||||
|
||||
const idleFrames = await orcaPage.evaluate(async () => {
|
||||
const samples = []
|
||||
let previous = performance.now()
|
||||
for (let index = 0; index < 4; index++) {
|
||||
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()))
|
||||
const now = performance.now()
|
||||
samples.push({ gapMs: now - previous, visibility: document.visibilityState, focused: document.hasFocus() })
|
||||
previous = now
|
||||
}
|
||||
return samples
|
||||
})
|
||||
console.log('[freeze-frame-control idle]', JSON.stringify(idleFrames))
|
||||
|
||||
const runId = `${Date.now()}`
|
||||
// First terminal on the SSH worktree.
|
||||
await ensureTerminalVisible(orcaPage, 45_000)
|
||||
@@ -148,16 +164,20 @@ test.describe('R2 Docker SSH bulk-open freeze', () => {
|
||||
|
||||
const interactionProbeMs = await orcaPage.evaluate(async () => {
|
||||
const started = performance.now()
|
||||
const frames: { elapsedMs: number; visibility: string; focused: boolean }[] = []
|
||||
const frame = () => new Promise<void>((resolve) => requestAnimationFrame(() => {
|
||||
frames.push({ elapsedMs: performance.now() - started, visibility: document.visibilityState, focused: document.hasFocus() })
|
||||
resolve()
|
||||
}))
|
||||
const state = window.__store?.getState()
|
||||
const view = state?.activeView
|
||||
state?.setActiveView(view === 'tasks' ? 'terminal' : 'tasks')
|
||||
await new Promise<void>((r) =>
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => r()))
|
||||
)
|
||||
await frame()
|
||||
await frame()
|
||||
state?.setActiveView(view ?? 'terminal')
|
||||
await new Promise<void>((r) =>
|
||||
requestAnimationFrame(() => requestAnimationFrame(() => r()))
|
||||
)
|
||||
await frame()
|
||||
await frame()
|
||||
console.log('[freeze-frame-control interaction]', JSON.stringify(frames))
|
||||
return performance.now() - started
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user