EPIC: Test isolation
メンテナーはふだん 1 日以内に返信
@josecelano がすでに取り組んでいます。
2026年9月30日 から。
評価
この issue はまだ評価されていません。
説明
Goal
Every automated test is independent of every other test and of other test runs in the same environment (one host, one Docker daemon). Each test owns the resources it uses: network ports, container images and names, filesystem paths, and process-global state. A test result then depends only on the code under test.
The purpose is a robust test suite without flaky tests. Faster CI through parallel runs is a side benefit, not the goal. Isolation also improves the code: a component that works with an OS-assigned port must report the address it bound (observability), and a component that accepts injected paths and names instead of globals is easier to test (testability).
Why
- Flaky runs. The full nextest suite fails intermittently with
AddrInUsebecause fixtures release a selected port before using it or claim fixed ports inside the ephemeral range (reproduced locally; also seen in the #2298 container build). - Colliding E2E runs. The E2E runner publishes fixed host ports, so a second run on the same Docker host fails.
- Wrong results without a failure. CI tags each run's image with a fixed name, so two runs on one Docker host can test each other's image and still pass.
- Unknown shared resources. #2386 did not audit container names, networks, or
/tmppaths; process-global state has no inventory.
Already isolated: #1419 (main-app integration suites use port 0 and temporary workspaces), #2132 (native-process fixture discovers its port from the startup log), and the qBittorrent E2E runner (random Compose project names, Docker-assigned host ports).
Subissues
Linked as GitHub sub-issues, in delivery order:
- Eliminate parallel test port allocation races (bug)
- Audit shared test resources (task)
- Use dynamic host ports in the E2E runner (task)
- Use a unique tracker image tag per CI run (task)
- #1419 - Allow multiple integration tests at the main app level (existing; blocked on #1488)
Isolation rules
- A test owns every resource it uses and releases it on success, failure, and drop paths.
- Prefer OS-assigned ports (port
0) and read the bound address back from the service. - Never select a port by binding and releasing it before the service under test binds it.
- Give per-run names to shared-namespace resources: image tags, containers, networks, Compose projects, and paths.
- Do not change process-global state from a test that shares its process with other tests.
- When a test contract needs a fixed resource, document why; fixed ports must be outside the ephemeral range.
Out of scope
Production default ports; the shared Cargo target directory between runner instances (a speed concern); runner instances and self-hosted runner setup; cooperative shutdown (#1488).
Related EPIC: #1840 (PR workflow performance). Related, not parent: isolation enables running several jobs per self-hosted server, but this EPIC is driven by robustness.
The full specification is added to docs/issues/open/ by a spec-only pull request.
- 主要言語
- Rust
- スター
- 532
- フォーク
- 56
- 平均マージ
- 11時間 20分
- マージ済み PR(30日)
- 282
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
torrust/torrust-tracker のほかの issue
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
torrust/torrust-tracker#3080 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
torrust/torrust-tracker#3069 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
torrust/torrust-tracker#3058 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
torrust/torrust-tracker#2978 ·
メンテナーはふだん 1 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
torrust/torrust-tracker#2332 ·
メンテナーはふだん 1 日以内に返信
torrust/torrust-tracker の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
difficulty: easy docs help wanted tooling
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
bug help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
userFRM/egui-charts#4386 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
eliasstravik/herdr-projects#1605 · コメント 1 件 ·