Skip to content

Conversation

@cristianrgreco
Copy link
Collaborator

@cristianrgreco cristianrgreco commented Apr 10, 2025

Fixes #982

To reproduce this we need to run the reaper container which invokes Wait.forLogMessage(). This MUST be done in vitest's globalSetup. Unlike setupFiles or in an individual test, vitest will wait for all processes to complete before shutting down.

The issue is introduced here: https://github.com/testcontainers/testcontainers-node/pull/977/files#diff-586d44bcd7d69ec116da37a953ccb21b6d22a17c3977e1b98eb487870b899007R20

The setTimeout runs in the background even after the reaper container has started, preventing the process from exiting. This PR incorporates abort signals between the setTimeout and the resolution of the log message, to ensure that when one succeeds, the other is aborted.

Struggling to add a test for this.


Tempted to simply revert the commit instead of try to fix forward, in case more issues are introduced: #984

@cristianrgreco cristianrgreco added bug Something isn't working patch Backward compatible bug fix labels Apr 10, 2025
@netlify
Copy link

netlify bot commented Apr 10, 2025

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit da4ed3f
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-node/deploys/67f798025473350008193653
😎 Deploy Preview https://deploy-preview-983--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cristianrgreco cristianrgreco marked this pull request as ready for review April 10, 2025 10:55
@cristianrgreco cristianrgreco marked this pull request as draft April 10, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working patch Backward compatible bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vitest test process hangs when using globalSetup

2 participants