diff --git a/src/services/agent-volumes-mounts.test.ts b/src/services/agent-volumes-mounts.test.ts index 4ba4befc9..09b21737b 100644 --- a/src/services/agent-volumes-mounts.test.ts +++ b/src/services/agent-volumes-mounts.test.ts @@ -557,7 +557,9 @@ describe('agent service', () => { expect(volumes).not.toContain(`${symlinkPath}:/host${symlinkPath}:ro`); }); } finally { - fs.rmSync(symlinkPath, { force: true }); + if (fs.existsSync(symlinkPath)) { + fs.unlinkSync(symlinkPath); + } fs.rmSync(symlinkTarget, { recursive: true, force: true }); } });