You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: storageCleanup test fails on macOS with the default TMPDIR #19532
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
Build, CI, or release tooling
Steps to reproduce
On macOS, keep the default TMPDIR (/var/folders/...).
Run vp test run apps/server/src/storageCleanup.test.ts.
Expected behavior
All storage cleanup tests pass.
Actual behavior
storage cleanup reports and local file policies > aggregates expired artifacts and rotated logs while retaining current logs fails (1 failed, 55 passed). Browser artifacts and rotated logs are reported as kept / No expired files instead of removed.
Likely cause: ServerConfig.layerTest with a prefix creates the test home with makeTempDirectoryScoped, which returns a /var/folders/... path. On macOS /var is a symlink to /private/var, so storage cleanup's symlink protection keeps the files instead of deleting them. Resolving the generated directory with fs.realPath in makeTest (explicit test paths unchanged) makes all 56 tests pass.
This is a test-harness bug, not a product bug: it only affects running the server tests locally on macOS. CI runs the server suite on Ubuntu (plus the Windows job), where TMPDIR has no symlink, so main stays green.
Confirmed on main: makeTest in apps/server/src/config.ts passes the raw fs.makeTempDirectoryScoped({ prefix }) path to deriveServerPaths without resolving it. On macOS that path is under /var/folders/..., and /var is a symlink to /private/var, so storage cleanup's symlink guard keeps the files and storageCleanup.test.ts fails at the "aggregates expired artifacts…" case. This is the same class as #9388 and #9389, which were fixed by resolving temp paths in the tests (see #9570 and #9573).
The fix you describe is the right size: call fs.realPath on the generated directory in makeTest only, and leave explicit baseDir arguments alone. A small PR doing just that is welcome. Until then, TMPDIR=/private/tmp works around it.
Activity
juliusmarminge commentedon Oct 14, 2026
Note
Grok responding on behalf of Julius.
This is a test-harness bug, not a product bug: it only affects running the server tests locally on macOS. CI runs the server suite on Ubuntu (plus the Windows job), where TMPDIR has no symlink, so main stays green.
Confirmed on main:
makeTestinapps/server/src/config.tspasses the rawfs.makeTempDirectoryScoped({ prefix })path toderiveServerPathswithout resolving it. On macOS that path is under/var/folders/..., and/varis a symlink to/private/var, so storage cleanup's symlink guard keeps the files andstorageCleanup.test.tsfails at the "aggregates expired artifacts…" case. This is the same class as #9388 and #9389, which were fixed by resolving temp paths in the tests (see #9570 and #9573).The fix you describe is the right size: call
fs.realPathon the generated directory inmakeTestonly, and leave explicitbaseDirarguments alone. A small PR doing just that is welcome. Until then,TMPDIR=/private/tmpworks around it.