Skip to content

test: stop timer/cache leaks and align queue default - #126

Merged
cursor[bot] merged 3 commits into
masterfrom
dougrathbone/hygiene-and-dev-deps-86e9
Sep 21, 2026
Merged

cursor[bot] merged 3 commits into
masterfrom
dougrathbone/hygiene-and-dev-deps-86e9

Conversation

@dougrathbone

Copy link
Copy Markdown
Owner

Summary

Closes three hygiene gaps from the last review: leaked Jest fake timers, ConfigLoader test module-graph mutation, and ThrottledQueue bypassing schema for its default cap. Dependabot #121 is already merged separately.

Changes

  • Install and restore fake timers per test in the connection-pool suite
  • Restore require.resolve and require.cache after standalone ConfigLoader load tests
  • Default ThrottledQueue maxSize from schema maxQueueSize

Test plan

  • npm test passes locally with no failures
  • New code has unit test coverage (aim for ≥ 60% on changed files)
  • Existing tests were not broken or removed without justification
  • npm run lint passes
  • npm run typecheck passes

Checklist

  • Version bumped in package.json and homeassistant-addon/config.yaml (if releasing)
  • CHANGELOG.md updated (if releasing)
  • No sensitive data or credentials included
Open in Web Open in Cursor 

cursoragent and others added 3 commits September 21, 2026 11:41
Install and restore Jest fake timers per test so later suites that
need real clocks, such as labelLoader watch, are not poisoned.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
The standalone settings test replaced require.resolve and require.cache
without putting them back, which can fail later tests in the same worker.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
ThrottledQueue used a hardcoded 1000 when maxSize was omitted, even
though the rest of the bridge reads maxQueueSize from schema.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@cursor
cursor Bot merged commit 19f3006 into master Sep 21, 2026
25 checks passed
@cursor
cursor Bot deleted the dougrathbone/hygiene-and-dev-deps-86e9 branch September 21, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants