Commit bcbf486
[e2e][flake] Prevent Windows flare archive collisions (#54911)
<!-- dd-meta {"pullId":"e285912b-314c-4a9c-9246-8b3688311611","source":"chat","resourceId":"c5d0b2d1-7ec1-45c4-a402-380c09336a86","workflowId":"1ac88243-5f8a-42d5-9538-b344b38e3abf","codeChangeId":"1ac88243-5f8a-42d5-9538-b344b38e3abf","sourceType":"assistant"} -->
<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->
### What does this PR do?
- Adds a process-local atomic counter suffix to flare archive filenames.
- Includes the process ID with the counter to keep the suffix readable and avoid same-second collisions with another local process.
- Keeps the existing timestamp and log-level filename context.
- Adds a deterministic regression test that verifies repeated archive names generated for the same timestamp do not collide.
### Motivation
Windows fails `os.Rename` when the destination archive already exists. `TestAgentTaskFlareSourceAndTags` creates several flare archives inside the same test process, with second-precision filenames. Once every ~2k runs, subtests created flares exactly at the same second in time, colliding on the file name.
A process-local atomic counter directly addresses those rapid same-process creations.
Jira: FLREM-150
### Describe how you validated your changes
- Test passes on the CI
Will keep monitoring for further failures.
### Additional Notes
None.
---
PR with help of Bits - [View session in Datadog](https://app.datadoghq.com/code/c5d0b2d1-7ec1-45c4-a402-380c09336a86)
Co-authored-by: datadog-bits <263423550+datadog-bits@users.noreply.github.com>
Co-authored-by: paola.ducolin <paola.ducolin@datadoghq.com>1 parent 7ba1833 commit bcbf486
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
144 | 147 | | |
145 | 148 | | |
146 | 149 | | |
147 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| |||
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
156 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
157 | 167 | | |
158 | 168 | | |
159 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
| |||
0 commit comments