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
test(imports): isolate remote-importer cache to a temp dir
TestResolveImportPaths_MixedPaths flaked on the Windows CI runner:
open C:\...\cache\atmos\stack-imports\<hash>.yaml:
The system cannot find the path specified.
The remote-import tests drive the package-global importer, which lazily
builds a real-user-cache-backed importer via getGlobalImporter() ->
globalImporterOnce.Do(). The tests tried to isolate it by assigning a
temp-cache importer after `globalImporterOnce = sync.Once{}`, but a freshly
reset Once still runs on the next getGlobalImporter() call and overwrites the
injection with a real-cache importer. So every remote-import test actually
wrote to (and read back from) the shared user cache dir — which races/flakes
on CI runners (Windows most visibly).
Add useTestGlobalImporter(t, cfg) which primes the Once (consumes it via
Do) so the injected temp-cache importer survives, and restores the globals on
cleanup. Route all remote-import tests through it.
Verified: with XDG_CACHE_HOME pointed at an empty dir, the package no longer
writes any stack-imports/*.yaml there — downloads stay in t.TempDir().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments