fix: close record repair and verification gaps

This commit is contained in:
bryanpedini committed 2026-11-19 15:46:12 +01:00
1 parent 9251c85fd8
commit adff599e08
27 files changed
+787 -153

No files matched your search

+18 -8
View File
@@ -211,15 +211,25 @@ test.describe('harness self-checks', () => {
test('the leak detection finds and removes resources of the run', async () => {
const name = `${project()}-leakprobe`;
const sentinel = `${project()}-unlabeled`;
const image = process.env.E2E_RUNNER_IMAGE as string;
const started = await docker(['run', '--detach', '--name', name, '--label', `${RUN_LABEL}=${project()}`, '--network', 'none', '--entrypoint', 'node', image, '-e', 'setTimeout(() => {}, 120000)']);
expect(started.code, started.stderr).toBe(0);
const allowed = new Set(STACK_SERVICES.map((s) => containerName(s)));
const leaks = await detectLeaks(allowed);
expect(leaks.join('\n')).toContain(name);
const gone = await docker(['inspect', name]);
expect(gone.code).not.toBe(0);
expect(await detectLeaks(allowed)).toEqual([]);
const volume = await docker(['volume', 'create', sentinel]);
expect(volume.code, volume.stderr).toBe(0);
try {
const started = await docker(['run', '--detach', '--name', name, '--label', `${RUN_LABEL}=${project()}`, '--network', 'none', '--entrypoint', 'node', image, '-e', 'setTimeout(() => {}, 120000)']);
expect(started.code, started.stderr).toBe(0);
const allowed = new Set(STACK_SERVICES.map((s) => containerName(s)));
const leaks = await detectLeaks(allowed);
expect(leaks.join('\n')).toContain(name);
const gone = await docker(['inspect', name]);
expect(gone.code).not.toBe(0);
expect(await detectLeaks(allowed)).toEqual([]);
const preserved = await docker(['volume', 'inspect', sentinel]);
expect(preserved.code, preserved.stderr).toBe(0);
} finally {
const removed = await docker(['volume', 'rm', sentinel]);
expect(removed.code, removed.stderr).toBe(0);
}
const ps = await run('docker', ['ps', '--format', '{{.Names}}', '--filter', `label=com.docker.compose.project=${project()}`]);
for (const service of STACK_SERVICES) expect(ps.stdout).toContain(containerName(service));
expect(Object.keys(GROUPS)).toHaveLength(9);