-
-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Labels
triageInvestigation requiredInvestigation required
Description
PS: I have read #383, but I'm reopening since no solution was provided there.
Expected Behaviour
Not to leak anything. Deno's test runner won't allow tests to pass if leaks are detected, for example.
Actual Behaviour
Leaks are reported. When using TESTCONTAINERS_RYUK_DISABLED=true, less leaks are reported, though.
Testcontainer Logs
❯ npx jest --detectLeaks
FAIL ./customer-repository.test.js
● Test suite failed to run
EXPERIMENTAL FEATURE!
Your test suite is leaking memory. Please ensure all references are cleaned.
There is a number of things that can leak memory:
- Async operations that have not finished (e.g. fs.readFile).
- Timers not properly mocked (e.g. setInterval, setTimeout).
- Keeping references to the global scope.
at onResult (node_modules/@jest/core/build/TestScheduler.js:150:18)
at node_modules/@jest/core/build/TestScheduler.js:254:19
at node_modules/emittery/index.js:363:13
at Array.map (<anonymous>)
at Emittery.emit (node_modules/emittery/index.js:361:23)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 5.484 s, estimated 17 s
Ran all test suites.Steps to Reproduce
- Setup the getting started example: https://testcontainers.com/guides/getting-started-with-testcontainers-for-nodejs/
npx jest --detectLeaks
Environment Information
- Operating System: Ubuntu 24.04.2 LTS
- Docker Version: 28.0.4
- Node version: 22.14.0
- Testcontainers version: 10.23.0
- Jest: 29.7.0
Metadata
Metadata
Assignees
Labels
triageInvestigation requiredInvestigation required