testcontainers-node
testcontainers-node copied to clipboard
feat: one shot wait startegy
Deploy Preview for testcontainers-node ready!
| Name | Link |
|---|---|
| Latest commit | c228531674821c8ad739021c30dfaa6de3f568ad |
| Latest deploy log | https://app.netlify.com/sites/testcontainers-node/deploys/661d33b8b3bd810007415f3e |
| Deploy Preview | https://deploy-preview-730--testcontainers-node.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
@omerlh I think the issue is that the container runtime strategy is injected into the wait strategy before it is initialised. There is a complexity in that the runtime initialisation is lazy, and a user defines their wait strategy before any container is started. I reckon you want to get the container runtime strategy in the wait strategy itself instead of passing it in.
I wasn't sure - I tried following the docs on creating a wait strategy that needs the container client, but seemed weird to me I need to pass it on the ctor. I guess you are saying I should not use StartupCheckStrategy here? Use AbstractWaitStrategy like log-wait-startegy?
I let myself change StartupCheckStrategy to get the container runtime only when checking but it is still failing with the same error...
I guess you are saying I should not use StartupCheckStrategy here? Use AbstractWaitStrategy like log-wait-startegy?
Yes that's right
So look at my latest changes - I think I did that, but it still failing...
Could you please add an example in the wait strategies doc?
Tests are failing:
FAIL packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts
● Test suite failed to run
packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts:26:8 - error TS2554: Expected 0 arguments, but got 1.
26 })(client);
~~~~~~
packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts:40:8 - error TS2554: Expected 0 arguments, but got 1.
40 })(client);
~~~~~~
packages/testcontainers/src/wait-strategies/startup-check-strategy.test.ts:58:8 - error TS2554: Expected 0 arguments, but got 1.
58 })(client);
Sure, I think I fixed both!
Thanks for merging!