You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove the temporary TOML and PEM files tests leave behind #2907
The configuration-file tests and the TLS tests remove every temporary file they create, on success, failure and drop paths.
This issue was narrowed on 2026-11-17. It first covered three leaks. The SQLite database leak (data_*.db) turned out to be larger than one issue and moved to #2924 and #2925.
Background
The shared-resource audit (#2394, finding F2) found test helpers that write files to std::env::temp_dir() with unique names and never remove them, or only when the test passes. This issue keeps two of them:
The configuration-file tests in packages/configuration/src/{v2_0_0,v3_0_0}/mod.rs: test_config_<uuid>.toml, never removed.
make_temp_file in packages/axum-server/src/tls.rs: <prefix>-<nanoseconds>.pem, removed only when the test passes.
The names are unique, so runs do not collide; the problem is accumulation. On one development machine, /tmp held 1,590 test_config_*.toml files.
Approach
Each test owns its file through a guard that removes it on drop. Proposed, to be confirmed by the maintainer: each configuration-file test writes inside its own tempfile::tempdir(), and make_temp_file returns a tempfile::NamedTempFile. Deleting files already leaked on a machine is out of scope.
Tasks
Reproduce: count the files one full test run leaves in a fresh TMPDIR.
Configuration-file tests: the file is removed when the test ends.
TLS tests: the files are removed when the test fails too.
Recheck: a full run leaves no test_config_*.toml and no PEM file.
The full specification is in docs/issues/open/2907-2392-remove-leaked-test-temporary-files/ISSUE.md.
Activity
docs(issues): [torrust#2392] add issue specifications for torrust#2906,
docs(issues): [torrust#2392] add orders 6 to 8, close AC4 and extend t…
docs(issues): [torrust#2392] refresh the torrust#2394 records and evi…
Merge #2910: docs(issues): [#2392] add the #2394 audit's new issues a…
[-]Remove the temporary files tests leave behind[/-][+]Remove the temporary TOML and PEM files tests leave behind[/+]docs(issues): [torrust#2902] name the pull request of the temporary-d…
docs(issues): [torrust#2902] name the issues that take the shared SQL…
docs(issues): [torrust#2902] give the F5 split its original reason
docs(issues): [torrust#2392] align the order 7 title and widen torrus…
docs(issues): [torrust#2392] keep torrust#2907's leak table in scope …
docs(issues): [#2902] record the tracker-core temporary-database fix
Merge #2923: test(tracker-core): [#2902] keep each test database in a…
docs(issues): [torrust#2392] make torrust#2925's goal depend on torru…
6 remaining items
docs(pr-reviews): [torrust#2907] add review audit for PR 2938 round 1
docs(pr-reviews): [torrust#2907] describe the current builder call in…
docs(pr-reviews): [torrust#2907] record the F8 reply in the PR 2938 a…
docs(issues): [#2907] record the T1 reproduction and the T2 design de…
test(configuration): [#2907] remove the TOML file the save-to-file te…
test(axum-server): [#2907] remove the TLS test PEM files also when a …
docs(issues): [#2907] record the V2 recheck and the pre-PR task review
Merge torrust#2938: test(configuration, axum-server): [torrust#2907] …
docs(pr-reviews): [torrust#2907] add review audit for PR 2947
chore(issues): archive closed issue #2907 spec to docs/issues/closed
Merge #2947: chore(issues): [#2907] archive the spec and mark order 7…
docs(issues): [torrust#2943] follow the torrust#2907 spec to docs/iss…
Merge #2944: docs(issues): [#2943] add the figment Jail environment i…
chore(issues): archive closed issue #2924 spec to docs/issues/closed