Skip to content

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

Open

Description

@jeremi

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).

Activity

  1. added
    bugSomething isn't working
    rustRust implementation work.
    on Nov 10, 2026
  2. jeremi commented on Nov 10, 2026

    @jeremi
    MemberAuthor

    Found while building #2634 (read-only external views in BReg); not fixed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:bregBReg ownership.bugSomething isn't workingrustRust implementation work.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions