event-normalizer-schema coverage test fails under host load: the folder-trust cache it warms at import expires (2 s TTL) before the ready fixture runs

Open Beginner friendly
#9,435 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js
Domain
testing

Research direction

Start with packages/server/tests/event-normalizer-schema.test.js and inspect how its ready fixture uses the folder-trust cache warmed at module load. Make the fixture independent of the 2 s cache expiry, then remove the ready fixture and confirm the coverage meta-test still reports the missing schema legibly. Keep behavior in packages/server/src/folder-trust.js unchanged and do not use --test-force-exit.

Written by the indexing model from the issue text.

Description

bug server testing

Description

packages/server/tests/event-normalizer-schema.test.js can fail under host load. The failing test is "exercises every schema listed in SCHEMA_BY_TYPE", which fails with:

every SCHEMA_BY_TYPE entry must be produced by a fixture
+ [ 'folder_trust_state' ]
- []

Its parent, EventNormalizer output → Server*Schema round-trip (#6841), then fails too.

The file warms the folder-trust scan cache once, at module load:

// `ready` answers the folder trust state only from a fresh cached scan.
getFolderTrustState('/tmp/test', { cached: true })

The cache is only fresh for SCAN_CACHE_TTL_MS = 2000 (packages/server/src/folder-trust.js:87, checked at ~1205). When the host is busy, more than 2 s can pass between module load and the ready fixture running. The ready event then carries no folder_trust_state, and the coverage meta-test fails.

Observed

On 2026-11-30 this failed once, in the pre-PR guard pack's sweep step for branch test/gemini-stream-pins (f5100d803), at a 1-minute load of about 10–15. That branch only adds tests to gemini-stream-bounds.test.js. The file passed twice in a row when run alone at about 9 (74/74), and the full server suite passed it on the same head.

Acceptance Criteria

  • The ready fixture's folder_trust_state no longer depends on wall-clock time since module load. Two ways:
    • warm the cache immediately before the fixture that needs it;
    • or inject the scan/clock the normalizer reads.
  • The coverage meta-test still fails, legibly, when a schema genuinely has no fixture. Prove it by removing the ready fixture.
  • No change to folder-trust.js behaviour, and no --test-force-exit.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 9m
Merged PRs (30d)
298

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.