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

オープン 初心者向け
#2,632 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
67/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, postgresql, rust
領域
devops, testing

調査の方向性

crates/registry-bregctl/tests/dev_lifecycle.rs と crates/registry-breg/tests/frozen_rhai_package.rs を読み、セッションのクリーンアップ動作と共有 TempDir の作成方法を調べます。該当するテストターゲットを実行し、コンテナ、ボリューム、一時ディレクトリが残らないことを確認します。停止したコンテナの状態を必要とするアサーションは維持します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Rust
スター
2
フォーク
0
平均マージ
7時間 43分
マージ済み PR(30日)
201

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

registrystack/registry-stack のほかの issue

registrystack/registry-stack の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。