Skip to content

Commit 2dba2e0

Browse files
sharon77242claude
andcommitted
fix: resolve 3 CI test failures
- Add !packages/agent/tests/fixtures/dev-private-key.pem negation to .gitignore and commit the fixture — two test suites (diagnostic-agent-coverage, license-validator) read this file at load time via readFileSync; the *.pem glob was silently excluding it from git causing ENOENT on the CI runner - Relax timing assertion in engine.test.ts: >= 20 → >= 5 ms setTimeout precision on GitHub Actions is not tight enough to guarantee performance.now() reports >= 20 ms after a 20 ms sleep - Relax timing assertion in container-web-db-worker.test.ts: >= 5 → >= 1 ms Same root cause — the assertion tests that traceQuery() measures duration at all, not that the OS timer is exact Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dcf2628 commit 2dba2e0

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ coverage/
77
.claude/
88
plans/
99
*.pem
10+
!packages/agent/tests/fixtures/dev-private-key.pem

packages/agent/tests/instrumentation/engine.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ describe("InstrumentationEngine", () => {
6666
const [event] = (await Promise.race([p, timeoutPromise])) as [TracedQuery];
6767

6868
assert.strictEqual(event.sanitizedQuery, "DELETE FROM table WHERE x = ?");
69-
assert.ok(event.durationMs >= 20);
69+
assert.ok(
70+
event.durationMs >= 5,
71+
`durationMs should reflect the sleep (got ${event.durationMs}ms)`,
72+
);
7073

7174
// Verify the source line is from this file
7275
assert.ok(

packages/agent/tests/scenarios/container-web-db-worker.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe("Scenario: Containerized Web + DB + Worker", () => {
174174

175175
assert.deepStrictEqual(result, [{ name: "Order #1" }]);
176176
assert.ok(captured.length === 1, "exactly one query event");
177-
assert.ok(captured[0].durationMs >= 5, "duration should reflect actual wait");
177+
assert.ok(captured[0].durationMs >= 1, "duration should reflect actual wait");
178178
});
179179

180180
it("traceQuery() still emits on failure", async () => {

0 commit comments

Comments
 (0)