- Notifications
You must be signed in to change notification settings - Fork923
Commit1f0e6ba
authored
fix: use raw syscalls to write binary we execute (#11684)
Fixes flake seen here, I thinkhttps://github.com/coder/coder/actions/runs/7565915337/job/20602500818golang's file processing is complex, and in at least some cases it can return from a file.Close() call without having actually closed the file descriptor.If we're holding open the file descriptor of an executable we just wrote, and try to execute it, it will fail with "text file busy" which is what we have seen.So, to be extra sure, I've avoided the standard library and directly called the syscalls to open, write, and close the file we intend to use in the test.I've also added some more logging so if it's some issue of multiple tests writing to the same location, the we might have a chance to see it.1 parentc5d73b8 commit1f0e6ba
2 files changed
+20
-1
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 |
| |
127 | 131 |
| |
128 | 132 |
| |
| |||
348 | 352 |
| |
349 | 353 |
| |
350 | 354 |
| |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
351 | 359 |
| |
352 | 360 |
| |
353 | 361 |
| |
|
Lines changed: 12 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
| |||
165 | 166 |
| |
166 | 167 |
| |
167 | 168 |
| |
168 |
| - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
169 | 179 |
| |
| 180 | + | |
170 | 181 |
| |
171 | 182 |
| |
172 | 183 |
| |
|
0 commit comments
Comments
(0)