Integration tests import tool modules inside tests and can time out under load
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- testing
調査の方向性
Read mcp-server/src/tools/__tests__/integration.test.ts, especially the dynamic imports and mock setup at the cited lines. Run the integration tests with cd mcp-server && npm test to observe the timeout and mock leakage. The acceptance criteria are to remove dynamic imports from test bodies and reset mocks between tests; linked pull request #175 is already open.
索引モデルが issue の本文から書いたものです。
説明
Summary
The healthCheck integration tests import the tool module inside the test body, so a cold import can exceed Vitest's 5 s default timeout under a full parallel run. The timed-out test then leaves a queued mock value behind and the next test fails too.
Where
mcp-server/src/tools/__tests__/integration.test.ts:42-77(await import("../healthCheck.js")insideit)mcp-server/src/tools/__tests__/integration.test.ts:37-39(vi.clearAllMocks()keepsmockResolvedValueOncequeues)
Details
Seen once in a full npx vitest run on Windows:
× returns pass/fail checklist from a single round trip 5858ms (Test timed out in 5000ms)
× passes node parameter to execSSH (expected undefined to be 'nas')
The same file passed alone, and three immediate full reruns passed. The second failure is a cascade: the first test's handler finished after its timeout and consumed the next test's mock, or its queued value was left behind.
Impact
Occasional red CI or release-gate runs that pass on retry, which hides real failures over time.
Suggested fix
- Import the tool modules at the top of the file (static imports) instead of inside each test.
- Reset mock state between tests with
vi.resetAllMocks()(ormockResetinafterEach) so a timed-out test cannot leak queued values.
Acceptance criteria
- No dynamic imports inside test bodies in integration.test.ts
- Mocks are reset between tests
Related: #164
Getting started
- Relevant files:
mcp-server/src/tools/__tests__/integration.test.ts - How to run tests:
cd mcp-server && npm ci && npm test
Filed by repo-audit/fix-issues at 4c8499a. Severity: low. Effort: S. audit-key: testing|mcp-server/src/tools/__tests__/integration.test.ts|dynamic-import-timeout
- 主要言語
- TypeScript
- スター
- 0
- フォーク
- 4
- 平均マージ
- 10時間 16分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/Home-Lab-Developer-Tools のほかの issue
-
speedtestResults ignores count: /api/speedtest/latest returns one result対応中かも @laozhej が 2 日前に担当しました。 オープンbug severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
TMHSDigital/Home-Lab-Developer-Tools#160 ·
メンテナーはふだん 1 日以内に返信
-
Grafana dashboard import to complete the export/import round trip対応中かも @laozhej が今日担当しました。 オープンenhancement severity: low
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
TMHSDigital/Home-Lab-Developer-Tools#171 ·
メンテナーはふだん 1 日以内に返信
-
help wanted severity: low testing
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
TMHSDigital/Home-Lab-Developer-Tools#164 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement severity: medium
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
TMHSDigital/Home-Lab-Developer-Tools#159 ·
メンテナーはふだん 1 日以内に返信
-
Add AdGuard local DNS rewrite tools (list, add, delete)対応中かも @laozhej が 1 日前に担当しました。 オープンenhancement severity: medium
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
TMHSDigital/Home-Lab-Developer-Tools#157 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/Home-Lab-Developer-Tools の issue をすべて見る
似ている issue
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/playwright#44289 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 半日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
blamechris/chroxy#9272 ·
メンテナーはふだん 1 日以内に返信
-
no-repo-link tool-submission
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
BraveOPotato/NoSignups#2458 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
drmrd/vernacular#1061 ·
メンテナーはふだん 1 日以内に返信