Repository navigation
fix windows .lnk shortcut tests on ci: short-path home defeats home aliasing - #18336
Conversation
… sandbox home The scheduled Windows e2e runs have failed on files_shortcuts.test.ts since PR #18275 merged: the sandbox HOME is derived from os.tmpdir(), which on the CI runners contains an 8.3 short-name component (C:\Users\RUNNER~1\...), while the shell stores and reports .lnk targets in long form. createAliasedPath's literal prefix match then fails, so a followed shortcut opens the target as a second, path-distinct document instead of ~/-aliased one. Two fixes: - e2e: canonicalize the sandbox path with fs.realpathSync.native, which (unlike the JS realpath) expands 8.3 short names on Windows. This also fixes the spurious "workdir is not under PW_SANDBOX" teardown warning. - rsession: normalize resolved shortcut targets with GetLongPathName (local paths only, keeping the no-network-I/O contract), so aliasing and duplicate-document detection are robust to short-form or case-mismatched stored targets regardless of environment.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Verified on the Windows CI runner via a branch dispatch of the e2e workflow (build from source + |
RStudio E2E - all platforms1 test(s) failed
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
Code review findingsActionable items from an automated multi-agent review. Important
Suggestions
|
gtritchie
left a comment
There was a problem hiding this comment.
A few findings worth a peek.
|
Thanks -- all five findings addressed in 8a11177:
|
Problem
The scheduled Windows Desktop e2e workflow has failed on every run since #18275 merged (first failure: run 29611045439, most recent: run 29955359944). The three failing tests are the file-shortcut cases in
files_shortcuts.test.ts.Root cause: the e2e sandbox derives HOME from
os.tmpdir(), which on the GitHub Windows runners contains an 8.3 short-name component (C:\Users\RUNNER~1\...).fs.realpathSyncdoes not expand short names (onlyfs.realpathSync.nativedoes), so rsession runs with a short-form HOME. The shell canonicalizes.lnktargets to long form, soIShellLink::GetPathreportsC:/Users/runneradmin/...andcreateAliasedPath's literal prefix match against home fails. The trace shows the direct consequence: following the shortcut opens the target as a second, path-distinct document (absolute path) alongside the~/-aliased one, sowaitForActiveDocument('~/...')times out and the columns dedupe test sees 3 source panels instead of 2.Fixes
fs.realpathSync.native, expanding 8.3 short names on Windows (identical behavior on macOS/Linux, verified). This also fixes the spurious[sandbox] R workdir ... is not under PW_SANDBOXteardown warnings, which were the same path-form mismatch.resolveWindowsShortcutnow normalizes local targets withGetLongPathName, so home aliasing and the client's duplicate-document detection are robust to short-form (or case-mismatched) stored targets regardless of environment. UNC/remote targets are skipped to keep the existing no-network-I/O contract, and a failed lookup (e.g. deleted target) keeps the stored path, preserving the broken-shortcut behavior covered byResolveReturnsStoredPathWhenTargetDeleted.Includes a new
WindowsShortcutTest.ResolvesStoredShortPathToLongFormgtest (skips when 8.3 names are disabled on the volume).Verification
tsc --noEmitpasses for the e2e change;fs.realpathSync.nativeverified equivalent tofs.realpathSyncon macOS.