Skip to content

Commit 2064a22

Browse files
committed
test: tighten completion latency budget to 100ms
Remove the 'faster than normal command' comparison (not useful since we want both fast). Tighten the latency budget from 500ms to 100ms — the UX threshold for instant tab completion.
1 parent 6f0cb48 commit 2064a22

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

test/e2e/completion.test.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,33 +50,14 @@ async function measureCommand(
5050
}
5151

5252
describe("completion latency", () => {
53-
test("completion is faster than a normal command", async () => {
54-
// Normal command loads telemetry, Stricli, all commands
55-
const normal = await measureCommand(["--version"]);
56-
57-
// Completion skips all heavy imports
58-
const completion = await measureCommand([
59-
"__complete",
60-
"issue",
61-
"list",
62-
"",
63-
]);
64-
65-
expect(normal.exitCode).toBe(0);
66-
expect(completion.exitCode).toBe(0);
67-
68-
// Completion should not be slower than a normal command
69-
expect(completion.duration).toBeLessThan(normal.duration);
70-
});
71-
72-
test("completion exits under latency budget", async () => {
53+
test("completion exits under 100ms", async () => {
7354
const result = await measureCommand(["__complete", "issue", "list", ""]);
7455

7556
expect(result.exitCode).toBe(0);
7657

77-
// 500ms budget — generous for CI (dev is ~60ms, binary ~190ms),
78-
// but catches regressions from the pre-fix ~530ms baseline.
79-
expect(result.duration).toBeLessThan(500);
58+
// 100ms is the UX threshold for "instant" tab completion.
59+
// Dev mode measures ~67ms; pre-optimization was ~530ms.
60+
expect(result.duration).toBeLessThan(100);
8061
});
8162

8263
test("completion exits cleanly with no stderr", async () => {

0 commit comments

Comments
 (0)