Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Document and align the units of sizes and durations

Abierto
#1,542 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
55/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, node.js, typescript
Área
api, testing

Línea de trabajo

Start with the listed files: packages/testcontainers/src/types.ts, test-container.ts, generic-container/generic-container.ts, and wait-strategies/composite-wait-strategy.ts. Document each numeric option's unit in JSDoc and add Date support for logs({ since }); the issue leaves the shared size unit decision open, and any unit change needs a major release. Done means the units are documented and Date is accepted, with the size decision resolved.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement minor

What happens

Numeric options use different units, and most of them say so only in the docs, or nowhere:

Option Unit Stated in the type or JSDoc
withResourcesQuota({ memory }) gigabytes inline comment
withResourcesQuota({ cpu }) CPUs inline comment
withSharedMemorySize(bytes) bytes parameter name
withStartupTimeout(startupTimeoutMs) milliseconds parameter name
HealthCheck.interval, timeout, startPeriod milliseconds no
stop({ timeout }), restart({ timeout }) milliseconds no
Compose down({ timeout }) milliseconds no
HttpWaitStrategy.withReadTimeout milliseconds parameter name
CompositeWaitStrategy.withDeadline(deadline) milliseconds no
logs({ since }) Unix timestamp in seconds no

Two stand out:

  • Memory is in gigabytes while shared memory is in bytes, so the same container can be configured with withResourcesQuota({ memory: 0.5 }) and withSharedMemorySize(512 * 1024 * 1024).
  • logs({ since }) is the only time value in seconds. It is passed straight to Docker, so a millisecond timestamp such as Date.now() is read as a time far in the future.

Expected

  • Every numeric option documents its unit in JSDoc, so it shows in the editor.
  • logs({ since }) also accepts a Date.
  • Decide whether sizes should share one unit.

Where

  • packages/testcontainers/src/types.ts
  • packages/testcontainers/src/test-container.ts
  • packages/testcontainers/src/generic-container/generic-container.ts
  • packages/testcontainers/src/wait-strategies/composite-wait-strategy.ts

Notes

  • Semver: JSDoc and accepting a Date are additive, hence minor. Changing the unit of an existing option would be major.
  • Related: #734 (memory quota units).

Dependencies

  • Nothing blocks this. It can start now.
Lenguaje dominante
TypeScript
Estrellas
2.6k
Forks
274
Merge medio
1 d 14 h
PR fusionados (30 d)
44

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de testcontainers/testcontainers-node

Todos los issues de testcontainers/testcontainers-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.