Commit b47f7bb
committed
Puppeteer/Playwright _refresh_symlink: idempotent when shim already matches
On macOS, chrome/chromium ship as ``.app`` bundles so the managed
``bin_dir`` shim is a shell-script launcher (``#!/bin/sh\nexec <path>``),
not a symlink. ``default_abspath_handler`` calls ``_refresh_symlink`` on
every ``load()``, which unconditionally deleted + rewrote the shim --
bumping its mtime each time. Tests that call ``install()`` then
``assert_shallow_binary_loaded`` (which re-stats the shim via
``get_abspath(no_cache=True)``) then observed ``loaded_mtime !=
resolved.stat().st_mtime_ns``, failing across every macOS puppeteer/
playwright test (8 playwright tests + test_chrome_alias in puppeteer).
Linux uses a real symlink and ``.resolve().stat()`` follows it to the
browser binary, whose mtime is stable -- so Linux CI was already green.
Skip the unlink+rewrite when the existing shim already points at
``target`` (symlink target equals path, or shell-script contents match
what we'd write). ``install()`` still always resolves the fresh path,
and a stale shim pointing at an old target still gets replaced.1 parent 38982f9 commit b47f7bb
2 files changed
Lines changed: 52 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
565 | | - | |
566 | 564 | | |
567 | 565 | | |
568 | 566 | | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
574 | 594 | | |
575 | 595 | | |
576 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
494 | 516 | | |
495 | 517 | | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
501 | 521 | | |
502 | 522 | | |
503 | 523 | | |
| |||
0 commit comments