test: avoid temp path collisions in install strip tests - #13664
test: avoid temp path collisions in install strip tests#13664eduardomourar wants to merge 1 commit into
Conversation
strip_source_file() reused a fixed hello.rs/hello_bin path in std::env::temp_dir(), which races when tests run in separate processes (e.g. under cargo nextest, which runs each test in its own process) and could pick up another process's file mid-write or mid-compile. Suffix both paths with the process PID.
Merging this PR will improve performance by 4.96%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | du_max_depth_balanced_tree[(6, 4, 10)] |
64.2 ms | 60.9 ms | +5.45% |
| ⚡ | Simulation | du_summarize_balanced_tree[(5, 4, 10)] |
16.4 ms | 15.7 ms | +4.48% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing eduardomourar:pr/test-install-pid-temp-path (9f3445a) with main (d183a67)2
Footnotes
-
46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(91f6543) during the generation of this report, so d183a67 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
|
No need. We can use other binaries. See #13612 |
|
So should we close that PR? |
|
Removing the function |
Function strip_source_file() reused a fixed hello.rs/hello_bin path in std::env::temp_dir(), which races when tests run in separate processes (e.g. under cargo nextest, which runs each test in its own process) and could pick up another process's file mid-write or mid-compile. Suffix both paths with the process PID.