Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a working container runtime strategy #768

Open
ahmed-deftoner opened this issue May 17, 2024 · 4 comments
Open

Could not find a working container runtime strategy #768

ahmed-deftoner opened this issue May 17, 2024 · 4 comments

Comments

@ahmed-deftoner
Copy link

ahmed-deftoner commented May 17, 2024

Expected Behaviour
Postgres Container should start

Actual Behaviour
Postgres Container did not start

Testcontainer Logs
Error: Jest: Got error running globalSetup - C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts, reason: Could not find a working container runtime strategy
at getContainerRuntimeClient (C:\Users\carbo\Projects\twin-premium-api\node_modules\testcontainers\build\container-runtime\clients\client.js:64:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PostgreSqlContainer.start (C:\Users\carbo\Projects\twin-premium-api\node_modules\testcontainers\build\generic-container\generic-container.js:54:24)
at async PostgreSqlContainer.start (C:\Users\carbo\Projects\twin-premium-api\node_modules@testcontainers\postgresql\build\postgresql-container.js:34:47)
at async initPostgres (C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts:12:22)
at async Promise.all (index 0)
at async init (C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts:7:5)
at async C:\Users\carbo\Projects\twin-premium-api\node_modules@jest\core\build\runGlobalHook.js:109:13
at async waitForPromiseWithCleanup (C:\Users\carbo\Projects\twin-premium-api\node_modules@jest\transform\build\ScriptTransformer.js:160:5)
at async ScriptTransformer.requireAndTranspileModule (C:\Users\carbo\Projects\twin-premium-api\node_modules@jest\transform\build\ScriptTransformer.js:808:16)

Steps to Reproduce

  1. Windows but ran tests in WSL2
  2. Docker version 24.0.7 and NodeJS version v20.12.1
  3. npx jest --config ./src/Tests/Integration/it.jest.json src/Tests/Integration/Agency/agency.it.spec.ts
  4. Error: Jest: Got error running globalSetup - C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts, reason: Could not find a working container runtime strategy

Environment Information

  • Operating System: Windows Subsystem For Linux
  • Docker Version: 24.0.7
  • Node version: v20.12.1
  • Testcontainers version: ^10.9.0
@ericvoshall
Copy link

Are you using MSW? I had an issue where MSW was swallowing requests to Docker to create test containers.

@kiview
Copy link
Member

kiview commented May 23, 2024

What is MSW?

Did you execute the tests as a WSL process? This path here C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts, reason: Could not find a working container runtime strategy looks like a Windows process, there will not be an OOTB integration between the Windows host and Docker within WSL if Docker Desktop is not used.

@ericvoshall
Copy link

MSW is a testing tool. There’s a related issue on their repo here.

@ahmed-deftoner
Copy link
Author

What is MSW?

Did you execute the tests as a WSL process? This path here C:\Users\carbo\Projects\twin-premium-api\Tests\Integration\setup.ts, reason: Could not find a working container runtime strategy looks like a Windows process, there will not be an OOTB integration between the Windows host and Docker within WSL if Docker Desktop is not used.

I run docker on WSL, and I executed all the commands on WSL and not Windows, but you're right, the path seems different, I'll verify it again though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants