Commit 089f938
committed
[Support][Jobserver][Tests] Simplify default executor init and make
jobserver tests deterministic
- Replace call-once wrapper in Parallel.cpp with a function-local static
default executor. Keep original Windows vs. non-Windows ManagedStatic
commentary and behavior: use ManagedStatic on Windows (so llvm_shutdown()
stops the pool), use a plain static elsewhere to avoid TLS teardown races
during shutdown.
- Rework Jobserver tests for parallelFor/parallelSort to run in a fresh
subprocess. The parent test spawns the current test binary with a gtest
filter selecting a child test, ensuring the child process initializes the
default executor after setting parallel::strategy = jobserver_concurrency()
and after setting up a FIFO-backed jobserver proxy. This makes the tests
reliable and independent from prior executor initialization in the combined
SupportTests binary.
This addresses review feedback:
- Remove unnecessary call-once wrapper around a function-local static.
- Fix flakiness: avoid changing strategy after the global executor exists
by running sensitive tests in a fresh process that controls initialization.1 parent e866c44 commit 089f938
File tree
2 files changed
+66
-35
lines changed- llvm
- lib/Support
- unittests/Support
2 files changed
+66
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 196 | + | |
206 | 197 | | |
207 | 198 | | |
208 | 199 | | |
| |||
221 | 212 | | |
222 | 213 | | |
223 | 214 | | |
224 | | - | |
225 | 215 | | |
226 | 216 | | |
227 | 217 | | |
228 | | - | |
229 | | - | |
| 218 | + | |
230 | 219 | | |
231 | 220 | | |
232 | 221 | | |
233 | 222 | | |
234 | 223 | | |
235 | 224 | | |
236 | | - | |
| 225 | + | |
237 | 226 | | |
238 | 227 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | 228 | | |
246 | 229 | | |
247 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
382 | 389 | | |
383 | 390 | | |
384 | 391 | | |
385 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
386 | 421 | | |
387 | 422 | | |
388 | 423 | | |
389 | 424 | | |
390 | 425 | | |
391 | | - | |
392 | | - | |
393 | 426 | | |
394 | | - | |
395 | 427 | | |
396 | | - | |
| 428 | + | |
397 | 429 | | |
398 | 430 | | |
399 | 431 | | |
400 | 432 | | |
401 | 433 | | |
402 | 434 | | |
403 | 435 | | |
404 | | - | |
405 | | - | |
| 436 | + | |
406 | 437 | | |
407 | 438 | | |
408 | 439 | | |
409 | | - | |
410 | 440 | | |
411 | 441 | | |
412 | 442 | | |
413 | 443 | | |
414 | | - | |
415 | | - | |
416 | 444 | | |
417 | 445 | | |
418 | 446 | | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
423 | 472 | | |
424 | 473 | | |
425 | 474 | | |
426 | 475 | | |
427 | 476 | | |
428 | 477 | | |
429 | | - | |
430 | 478 | | |
431 | 479 | | |
432 | 480 | | |
| |||
0 commit comments