test: reduce RPC catalog loading in WebSocket budget suites (#29619)

* test: route legacy relay database fixtures through Node

* test: require process exit after daemon cleanup loses contact

* test: limit WebSocket budget suites to their RPC handlers

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-16 04:09:13 -07:00
committed by GitHub
co-authored by OrcaWin
parent f1677dbf4e
commit dfc94d7e3c
2 changed files with 19 additions and 2 deletions
@@ -1,3 +1,4 @@
import './rpc/unused-default-rpc-methods.test-fixture'
import { mkdtempSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
@@ -8,6 +9,8 @@ import { OrcaRuntimeService } from './orca-runtime'
import { OrchestrationDb } from './orchestration/db'
import { OrcaRuntimeRpcServer } from './runtime-rpc'
import { DeviceRegistry } from './device-registry'
import { ORCHESTRATION_CHECK_METHODS } from './rpc/methods/orchestration/messaging/check-methods'
import { ORCHESTRATION_ASK_METHODS } from './rpc/methods/orchestration/messaging/ask-methods'
import {
withCurrentOrchestrationContract,
waitFor,
@@ -45,6 +48,7 @@ describe('OrcaRuntimeRpcServer', () => {
vi.spyOn(runtime, 'getTerminalPaneKey').mockImplementation((handle) => `tab_${handle}:leaf`)
const server = new OrcaRuntimeRpcServer({
runtime,
methods: [...ORCHESTRATION_CHECK_METHODS, ...ORCHESTRATION_ASK_METHODS],
userDataPath,
enableWebSocket: false,
longPollCap: 1
@@ -126,6 +130,7 @@ describe('OrcaRuntimeRpcServer', () => {
// Why: cap 4 → ask sub-cap 2, so the third ask must be shed while waits keep the other half.
const server = new OrcaRuntimeRpcServer({
runtime,
methods: [...ORCHESTRATION_CHECK_METHODS, ...ORCHESTRATION_ASK_METHODS],
userDataPath,
enableWebSocket: false,
longPollCap: 4
@@ -214,7 +219,12 @@ describe('OrcaRuntimeRpcServer', () => {
configureNotificationDismissalStore: () => {},
getRuntimeId: () => 'test-runtime'
} as unknown as OrcaRuntimeService
const server = new OrcaRuntimeRpcServer({ runtime, userDataPath, enableWebSocket: false })
const server = new OrcaRuntimeRpcServer({
runtime,
methods: [],
userDataPath,
enableWebSocket: false
})
server['deviceRegistry'] = new DeviceRegistry(userDataPath)
const entry = server['deviceRegistry']!.addDevice('runtime-test', 'runtime')
const ws = new FakeWebSocket()
@@ -1,3 +1,4 @@
import './rpc/unused-default-rpc-methods.test-fixture'
import { mkdtempSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
@@ -6,6 +7,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest'
import { OrcaRuntimeService } from './orca-runtime'
import { OrcaRuntimeRpcServer } from './runtime-rpc'
import { DeviceRegistry } from './device-registry'
import { FILE_METHODS } from './rpc/methods/files'
import { E2EEChannel } from './rpc/e2ee-channel'
import { decrypt, deriveSharedKey, encrypt, generateKeyPair } from './rpc/e2ee-crypto'
import { REMOTE_RUNTIME_MAX_OUTBOUND_JSON_BYTES } from '../../shared/remote-runtime-memory-limits'
@@ -24,7 +26,12 @@ function hugeListing(): DirEntry[] {
function createServer() {
const userDataPath = mkdtempSync(join(tmpdir(), 'orca-runtime-rpc-reply-size-'))
const runtime = new OrcaRuntimeService()
const server = new OrcaRuntimeRpcServer({ runtime, userDataPath, enableWebSocket: false })
const server = new OrcaRuntimeRpcServer({
runtime,
methods: FILE_METHODS,
userDataPath,
enableWebSocket: false
})
server['deviceRegistry'] = new DeviceRegistry(userDataPath)
const device = server['deviceRegistry'].addDevice('paired-desktop', 'runtime')
return { runtime, server, device }