mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 00:03:08 +00:00
test: stop restating internal tuning constants, keep the ones that are contracts (#23950)
Removes ~74 assertions of the form `expect(SOME_CONSTANT).toBe(<literal>)` where the literal is an internal tuning value — a timeout, retry count, debounce interval, cache TTL, circuit-breaker window, Tailwind class string. Those cannot fail for any reason a user would notice: they fail only when someone deliberately changes the number, and then the test is simply updated. They are copies of the declaration. The same pattern is NOT junk when the exact value is observable outside this process, so those were deliberately kept: - terminal byte contracts: `\r`, `\x03` ETX, Kitty escapes, `\x1b[?1;2c`; - wire and capability values: `agent.launch.v2`, protocol 3 / min-compatible 2, daemon per-feature boundary versions (a daemon survives app updates, so those pin what an old field daemon may be trusted with), relay header tokens; - security invariants: the `127.0.0.1` bind default, an empty iframe `sandbox`; - values external processes read: exit code 78 (EX_CONFIG) and exit code 3 (systemd `RestartPreventExitStatus`), `ORCA_AGENT_SESSION_SPAWN_TOKEN`, `npx skills …` commands users paste, on-disk journal schema versions, the `orca_<hash>` filename prefix the fish sweeper matches; - third-party names: expo-router's `unstable_settings` / `ErrorBoundary`, iOS Safari's 16px zoom threshold. Where a case asserted a relation rather than a literal — `A < B`, a sum of parts, a cap compared against a sibling budget — the relation stays and only the literal went. Test-only changes: no production file is touched and no test file is deleted.
This commit is contained in:
@@ -1,15 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
GIT_READ_TIMEOUT_MS,
|
||||
GitCommandTimeoutError,
|
||||
gitCommandTimeoutMs
|
||||
} from './git-command-timeout'
|
||||
import { GitCommandTimeoutError, gitCommandTimeoutMs } from './git-command-timeout'
|
||||
|
||||
describe('gitCommandTimeoutMs', () => {
|
||||
it('pins the production read deadline', () => {
|
||||
expect(GIT_READ_TIMEOUT_MS).toBe(120_000)
|
||||
})
|
||||
|
||||
it.each([
|
||||
[['status', '--porcelain=v2'], 120_000],
|
||||
[['show', 'HEAD:file'], 120_000],
|
||||
|
||||
@@ -2,8 +2,6 @@ import { afterEach, describe, expect, it } from 'vitest'
|
||||
import {
|
||||
GENERAL_CAP,
|
||||
GitAdmissionScheduler,
|
||||
MAX_GIT_CHILDREN,
|
||||
NETWORK_CAP,
|
||||
_gitAdmissionSnapshotForTests,
|
||||
_resetGitAdmissionForTests,
|
||||
acquireGitAdmission
|
||||
@@ -33,11 +31,9 @@ afterEach(() => {
|
||||
})
|
||||
|
||||
describe('GitAdmissionScheduler', () => {
|
||||
it('pins the global base budgets and absolute maximum', () => {
|
||||
it('pins the global base budget bounds', () => {
|
||||
expect(GENERAL_CAP).toBeGreaterThanOrEqual(2)
|
||||
expect(GENERAL_CAP).toBeLessThanOrEqual(4)
|
||||
expect(NETWORK_CAP).toBe(3)
|
||||
expect(MAX_GIT_CHILDREN).toBe(10)
|
||||
})
|
||||
|
||||
it('keeps base and headroom counters separate and grants interactive all-headroom', async () => {
|
||||
|
||||
Reference in New Issue
Block a user