Skip to content

Commit 607f7ed

Browse files
mchwangclaude
andcommitted
Name a failed foreign-keeper removal after a pass (#189)
Review round 51: as on main, a docker rm of the foreign keeper that fails after the test's checks pass fails the test with Docker's own error, before the storage release's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 067c713 commit 607f7ed

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎test/agent-container.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,13 +2583,16 @@ describe('real Docker agent isolation', () => {
25832583
expect(spawnSync('docker', ['volume', 'inspect', filesystems.workVolume]).status).not.toBe(0);
25842584
passed = true;
25852585
} finally {
2586-
spawnSync('docker', ['rm', '--force', filesystems.keeper], { stdio: 'ignore', ...CLIENT_LIMIT });
2586+
const keeperRemoved = spawnSync('docker', ['rm', '--force', filesystems.keeper], { encoding: 'utf8', ...CLIENT_LIMIT });
25872587
// A failure above stays the one reported: what the removal leaves, the allocation sweep below removes, the keeper
2588-
// with another runner's label included (#189). After a pass, the storage must release once the foreign keeper is
2589-
// gone, so its failure fails the test. The sweep may take up to 5.5 minutes, which the test's budget allows for.
2588+
// with another runner's label included (#189). After a pass, the foreign keeper's removal and then the storage's
2589+
// release must succeed, as on main, so either failure fails the test, the keeper's first. The sweep may take up to
2590+
// 5.5 minutes, which the test's budget allows for.
25902591
let released: unknown;
25912592
try { removeTaskFilesystems(filesystems); } catch (error) { released = error; console.warn('cleanup: removing the storage failed:', error); }
25922593
removeLabelledObjects('io.codeboost.allocation', owner.allocationId, 'test');
2594+
if (passed && keeperRemoved.status !== 0) throw new Error(`docker rm --force ${filesystems.keeper} failed: `
2595+
+ (keeperRemoved.error?.message ?? (keeperRemoved.signal ? `killed by ${keeperRemoved.signal}` : keeperRemoved.stderr?.trim())));
25932596
if (passed && released) throw released;
25942597
}
25952598
}, 7 * 60_000);

0 commit comments

Comments
 (0)