Skip to content

Commit 66a5d33

Browse files
committed
fix(test): skip browser cache dirs in copyDirIfExists to prevent ENOSPC
copyDirIfExists recursively copies LIVE_EXTERNAL_AUTH_DIRS (including .gemini) into temp home during live test setup. When .gemini contains a browser profile with multi-GB cache, this fills /tmp and causes ENOSPC. Add a filter to skip known cache directory patterns (Cache, Cache_Data, GPUCache, browser_recordings, antigravity-browser-profile, Service Worker CacheStorage). Fixes #91893
1 parent dbf1b74 commit 66a5d33

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎test/test-env.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,15 @@ function ensureParentDir(targetPath: string): void {
249249
fs.mkdirSync(path.dirname(targetPath), { recursive: true });
250250
}
251251

252+
const COPY_EXCLUDE_PATTERNS = [
253+
`${path.sep}Cache${path.sep}`,
254+
`${path.sep}Cache_Data`,
255+
`${path.sep}GPUCache${path.sep}`,
256+
`${path.sep}browser_recordings${path.sep}`,
257+
`${path.sep}antigravity-browser-profile${path.sep}`,
258+
`Service Worker${path.sep}CacheStorage`,
259+
];
260+
252261
function copyDirIfExists(sourcePath: string, targetPath: string): void {
253262
if (!fs.existsSync(sourcePath)) {
254263
return;
@@ -257,6 +266,7 @@ function copyDirIfExists(sourcePath: string, targetPath: string): void {
257266
fs.cpSync(sourcePath, targetPath, {
258267
recursive: true,
259268
force: true,
269+
filter: (src) => !COPY_EXCLUDE_PATTERNS.some((p) => src.includes(p)),
260270
});
261271
}
262272

0 commit comments

Comments
 (0)