test(integration): add application lifecycle fixture - #2086
Merged
josecelano merged 3 commits intoAug 24, 2026
Merged
Conversation
josecelano
force-pushed
the
1419-allow-multiple-integration-tests
branch
from
August 24, 2026 13:20
4b112d7 to
02bb268
Compare
There was a problem hiding this comment.
Pull request overview
Adds an explicit main-application integration-test lifecycle fixture (TrackerApplicationFixture) so suites own their isolated workspace + application container + JobManager, and can request/await shutdown before releasing the temporary workspace (aligning with issue #1419’s execution model and verification evidence).
Changes:
- Introduces
TrackerApplicationFixtureto centralize integration-suite startup and awaited shutdown sequencing. - Migrates existing main-level integration suites (metrics, UDP policy, banning, scaffold) from implicit
_jobsdrop cleanup to explicitfixture.shutdown().await. - Updates test/docs guidance and issue-spec verification evidence to reflect the new lifecycle ownership model.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/common/workspace.rs | Adds TrackerApplicationFixture, workspace path access, and shared shutdown grace period used by suites. |
| tests/common/mod.rs | Re-exports TrackerApplicationFixture for suite consumption. |
| tests/scaffold.rs | Updates the scaffold sample to use the fixture and documents explicit awaited shutdown. |
| tests/metrics/port_zero.rs | Uses fixture and adds a focused ordering assertion that workspace cleanup occurs after awaited shutdown. |
| tests/metrics/fixed_ports.rs | Migrates fixed-port metrics suite to fixture lifecycle. |
| tests/metrics/udp_error_enabled_port_zero.rs | Migrates UDP error-policy (enabled) suite to fixture lifecycle. |
| tests/metrics/udp_error_disabled_port_zero.rs | Migrates UDP error-policy (disabled) suite to fixture lifecycle. |
| tests/banning/udp_metrics_disabled_port_zero.rs | Migrates banning suite to fixture lifecycle. |
| tests/AGENTS.md | Updates contributor guidance to require explicit fixture shutdown and clarifies process-global constraints. |
| docs/issues/open/1419-allow-multiple-integration-tests-at-main-app-level/ISSUE.md | Reconciles issue spec with current test structure and records verification evidence and lifecycle findings. |
| docs/issues/open/1419-allow-multiple-integration-tests-at-main-app-level/completion-plan.md | Adds/updates decision record for lifecycle fixture approach and mandatory verification protocol. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
josecelano
force-pushed
the
1419-allow-multiple-integration-tests
branch
from
August 24, 2026 15:11
16a671c to
af5ddb7
Compare
Member
Author
|
ACK af5ddb7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
TrackerApplicationFixturefor main-application integration suites. The fixture owns the isolated workspace, application container, andJobManager, then invokes the best shutdown sequence exposed by current production before releasing the workspace._jobsdrop cleanup.Verification
cargo test --test metrics-fixed-ports --test metrics-port-zero --test metrics-udp-error-enabled-port-zero --test metrics-udp-error-disabled-port-zero --test banning-udp-metrics-disabled-port-zero --test scaffoldcargo test --test metrics-port-zero -- --nocapturecargo test --test metrics-port-zero -- --test-threads=1TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-commit.sh --format=jsonScope and Follow-up
Partially addresses #1419; it intentionally remains open.
Current server jobs can consume
JobManager::wait_for_all's per-job timeout because they do not yet react to the shared cancellation token. This change makes test lifecycle ownership explicit but does not claim cooperative server completion. Production shutdown coordination is deferred to #1488 and draft PR #1993; this PR does not introduce a competing shutdown mechanism.