I’m running my Node.js unit test with Tap.js lib, using testcontainers last version (10.9.0).
Whenever I start the tests, the container are succesfully created, but testcontainer/ryuk kills them while tests are still running.
The npm command I run the tests is:
tap --before=test/scripts/executors/before.js --after=test/scripts/executors/teardown.js --node-arg=--require=ts-node/register
In the before.js file I am creating all the containers I need with testcontainers lib. Then after the before.js is executed tap run all the test inside “test/unit” folder.
Here is the log of the ryuk container, stopping during the tests:
2024-05-07 21:41:29 2024/05/07 19:41:29 Pinging Docker...
2024-05-07 21:41:29 2024/05/07 19:41:29 Docker daemon is available!
2024-05-07 21:41:29 2024/05/07 19:41:29 Starting on port 8080...
2024-05-07 21:41:29 2024/05/07 19:41:29 Started!
2024-05-07 21:41:29 2024/05/07 19:41:29 New client connected: 192.168.65.1:37043
2024-05-07 21:41:29 2024/05/07 19:41:29 Adding {"label":{"org.testcontainers.session-id=595d104f2d9d":true}}
2024-05-07 21:41:33 2024/05/07 19:41:33 EOF
2024-05-07 21:41:33 2024/05/07 19:41:33 Client disconnected: 192.168.65.1:37043
2024-05-07 21:41:43 2024/05/07 19:41:43 Timed out waiting for re-connection
2024-05-07 21:41:43 2024/05/07 19:41:43 Removed 1 container(s), 0 network(s), 0 volume(s) 0 image(s)
I noticed that immediately after the before.js file is executed, the container log this command, that eventually shuts all down:
2024-05-07 21:41:33 2024/05/07 19:41:33 EOF