Skip to content

Conversation

@digital88
Copy link
Contributor

#960

  • Added class Ms which provides conversion from ms to nanos and seconds.
  • Explicitly call this class' conversion methods when calling Docker APIs. Example:
...
log.debug(`Stopping container...`, { containerId: container.id });
const t = new Ms(opts?.timeout ?? 0).seconds();
await container.stop({ t });
...
  • Renamed parameters in all public APIs to tell that value in ms expected to be passed.
  • Renamed some internal fields and methods to tell that value in ms expected there.
  • Added docs for timeouts.
  • Updated old docs where timeouts are used.

@netlify
Copy link

netlify bot commented Mar 26, 2025

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit 7e6f588
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/683357db4170530008902582
😎 Deploy Preview https://deploy-preview-962--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 project configuration.

@cristianrgreco cristianrgreco added enhancement New feature or request major An incompatible API change labels Mar 26, 2025
@cristianrgreco cristianrgreco added this to the 11.0.0 milestone Mar 26, 2025
try {
log.debug(`Stopping container...`, { containerId: container.id });
await container.stop({ t: opts?.timeout });
await container.stop({ t: toSeconds(opts?.timeout ?? 0) });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: these are the reasons why this is a breaking change

@cristianrgreco cristianrgreco changed the title Refactor of timeouts Container stop timeouts should be in milliseconds May 23, 2025
@cristianrgreco cristianrgreco merged commit 7f0501c into testcontainers:main May 25, 2025
776 of 778 checks passed
@cristianrgreco cristianrgreco added maintenance Improvements that do not change functionality and removed enhancement New feature or request labels May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improvements that do not change functionality major An incompatible API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants