Skip to content

Commit bd96847

Browse files
Mossakaclaude
andcommitted
test: add cleanup test for chroot-home directory
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0130718 commit bd96847

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/docker-manager.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,6 +2089,18 @@ describe('docker-manager', () => {
20892089
expect(fs.existsSync(testDir)).toBe(false);
20902090
});
20912091

2092+
it('should clean up chroot-home directory alongside workDir', async () => {
2093+
// Create chroot-home sibling directory (as writeConfigs does in chroot mode)
2094+
const chrootHomeDir = `${testDir}-chroot-home`;
2095+
fs.mkdirSync(chrootHomeDir, { recursive: true });
2096+
2097+
await cleanup(testDir, false);
2098+
2099+
// Both workDir and chroot-home should be removed
2100+
expect(fs.existsSync(testDir)).toBe(false);
2101+
expect(fs.existsSync(chrootHomeDir)).toBe(false);
2102+
});
2103+
20922104
it('should preserve agent logs when they exist', async () => {
20932105
// Create agent logs directory with a file
20942106
const agentLogsDir = path.join(testDir, 'agent-logs');

0 commit comments

Comments
 (0)