Commit 4aa5e2f
committed
web: uniquify temp file paths in tests to avoid PID-collision races
tempHtml/tempPng wrote to /tmp/web_test_<label>.{html,png} with no
per-process suffix. Concurrent invocations of the same gtest case
(CI parallel jobs / retries / sharding) raced on the same path:
one process's std::ofstream truncated another's in-flight write,
producing a half-written file that was missing varying substrings
depending on flush timing.
Append getpid() to the filename so each process owns a private path.
Verified by reproducing the race with 32 parallel runs of
SaveReportTest.ContainsInlinedJS (100% failure before, 0% after).
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>1 parent 95bfbab commit 4aa5e2f
2 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | | - | |
83 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
63 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
| |||
0 commit comments