test(breg): the source successor test and frozen_rhai_package leak a container, a volume and a temp dir every run

Abierto Apto para principiantes
#2,632 1 comentario 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
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
67/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, postgresql, rust
Área
devops, testing

Línea de trabajo

Lee crates/registry-bregctl/tests/dev_lifecycle.rs y crates/registry-breg/tests/frozen_rhai_package.rs, y luego inspecciona el comportamiento de limpieza de la sesión y cómo se crea el TempDir compartido. Ejecuta los objetivos de prueba afectados y comprueba que no dejen ningún contenedor, volumen ni directorio temporal; conserva las aserciones que necesitan el estado del contenedor detenido.

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

Descripción

area:breg bug rust

What happens

Two BReg test targets leave resources behind on every run:

  1. crates/registry-bregctl/tests/dev_lifecycle.rs: the source successor test ends with session.stop(); std::mem::forget(session);. stop() keeps the container and its volume, and forget skips the session's Drop cleanup, so each run leaves one breg-dev PostgreSQL container and one breg-dev-<uuid> volume. The two tests that call session.remove() before forget are fine.
  2. crates/registry-breg/tests/frozen_rhai_package.rs: the shared base copy is a tempfile::TempDir held in a static OnceLock. Statics are never dropped, so every run leaves one breg-native-package-* directory under TMPDIR.

On a developer machine these pile up across runs (disk, Docker volumes) and make container-ownership checks noisier.

Suggested fix

  1. Call session.remove() (after the assertions that need the stopped state) before forget, or drop forget if Drop already does the right cleanup.
  2. Keep the base copy in a TempDir owned by the test (or created per test), or register a removal at process exit. If the shared copy is kept for speed, use a stable, named path under the target directory that each run reuses.

Found while verifying the external record projections branch (feat/breg-external-views).

Lenguaje dominante
Rust
Estrellas
2
Forks
0
Merge medio
7 h 43 min
PR fusionados (30 d)
201

Preparar el entorno

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 registrystack/registry-stack

Todos los issues de registrystack/registry-stack

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.