Make container reuse safe across processes
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, node.js, typescript
Línea de trabajo
Read reuseOrStartContainer in packages/testcontainers/src/generic-container/generic-container.ts and the existing withFileLock implementation in packages/testcontainers/src/common/file-lock.ts. Check the tests for reusable container startup and run the relevant test suite with multiple processes to reproduce the race. Done means concurrent callers on the same host share one container; the issue notes that #1522 and #1552 also change this function, so coordinate around that overlap.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
withReuse() looks for an existing container and creates one if there is none. That lookup-then-create is guarded by an in-process lock (AsyncLock), so two processes can both find nothing and both create a container.
Test runners commonly run test files in separate processes or workers. Starting the same reusable configuration from three processes at once created two containers. The extra one is never cleaned up, because reusable containers carry no session label.
Expected
Lookup-or-create is atomic across processes on the same host, so concurrent callers end up sharing one container.
Where
reuseOrStartContainer in packages/testcontainers/src/generic-container/generic-container.ts.
Notes
withFileLockinpackages/testcontainers/src/common/file-lock.tsalready serialises Ryuk and SSHD startup across processes. The same mechanism fits here.- Related: #1172, where the answer was to use the test runner's global setup. That remains the better fit for one shared container, but
withReuse()is also used to keep containers between runs, where the race still applies. - Reproduced on
main(aa60a746, 12.2.0) with Docker 29.6.1.
Dependencies
- Stack on #1522, #1552: all three rewrite
reuseOrStartContainer.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.6k
- Forks
- 274
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 44
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de testcontainers/testcontainers-node
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
testcontainers/testcontainers-node#1539 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
testcontainers/testcontainers-node#1533 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
testcontainers/testcontainers-node#1531 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
testcontainers/testcontainers-node#1529 ·
Los mantenedores suelen responder en 1 día
-
enhancement minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
testcontainers/testcontainers-node#1528 ·
Los mantenedores suelen responder en 1 día
Todos los issues de testcontainers/testcontainers-node
Issues similares
-
Endpoint links in the tag operations list are below the 24px target sizePosiblemente ocupada @AdzerKI la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
ai-driven-qa bug Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
linagora/twake-tasks#435 ·
Los mantenedores suelen responder en 1 día
-
bug domain: database priority: p1 Stellar Wave
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
StellarState/SS-backend#632 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
A2A audit timestamps end in +00:00Z (invalid ISO 8601)Posiblemente ocupada @O1sumitkumar la tomó hoy. Abiertobug good first issue help wanted python
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`cf complete zsh >> .zshrc` fails on vanilla zshQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/cf#340 ·
Los mantenedores suelen responder en 1 día