Integration tests import tool modules inside tests and can time out under load
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- testing
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 4
- Merge medio
- 10h 16m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/Home-Lab-Developer-Tools
-
speedtestResults ignores count: /api/speedtest/latest returns one resultForse già presa @laozhej l’ha presa 2 giorni fa. Apertabug severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
TMHSDigital/Home-Lab-Developer-Tools#160 ·
I maintainer di solito rispondono entro 1 giorno
-
Grafana dashboard import to complete the export/import round tripForse già presa @laozhej l’ha presa oggi. Apertaenhancement severity: low
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
TMHSDigital/Home-Lab-Developer-Tools#171 ·
I maintainer di solito rispondono entro 1 giorno
-
help wanted severity: low testing
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
TMHSDigital/Home-Lab-Developer-Tools#164 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement severity: medium
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
TMHSDigital/Home-Lab-Developer-Tools#159 ·
I maintainer di solito rispondono entro 1 giorno
-
Add AdGuard local DNS rewrite tools (list, add, delete)Forse già presa @laozhej l’ha presa 1 giorno fa. Apertaenhancement severity: medium
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
TMHSDigital/Home-Lab-Developer-Tools#157 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TMHSDigital/Home-Lab-Developer-Tools
Issue simili
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
microsoft/playwright#44289 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
blamechris/chroxy#9272 ·
I maintainer di solito rispondono entro 1 giorno
-
no-repo-link tool-submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
BraveOPotato/NoSignups#2458 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
drmrd/vernacular#1061 ·
I maintainer di solito rispondono entro 1 giorno