Skip to content

Commit a28b617

Browse files
Dumbrisclaude
andcommitted
test(server): close bolt DB before TempDir cleanup (Windows unlink failure)
TestScanSummaryEnricherAdapterCarriesDeepScan passed its assertions but failed on windows-latest: t.TempDir cleanup cannot unlink config.db while the bbolt handle is open. setupTestStorage registers no close; add an explicit t.Cleanup in this test's seed helper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f6dcf5d commit a28b617

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/server/scan_summary_enricher_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ func TestScanSummaryEnricherAdapterCarriesDeepScan(t *testing.T) {
2727
t.Helper()
2828
dir := t.TempDir()
2929
db := setupTestStorage(t)
30+
// Close the bolt DB before t.TempDir cleanup — Windows cannot unlink
31+
// config.db while the handle is open (setupTestStorage registers none).
32+
t.Cleanup(func() { _ = db.Close() })
3033
svc := scanner.NewService(db, scanner.NewRegistry(dir, logger), scanner.NewDockerRunner(logger), dir, logger)
3134
now := time.Now()
3235
require.NoError(t, db.SaveScanJob(&scanner.ScanJob{

0 commit comments

Comments
 (0)