Skip to content

Commit 5fe2b50

Browse files
committed
Fix Windows CI: close SQLite before TempDir cleanup
Add t.Cleanup(router.CloseAll) to snippet and watcher test helpers. Windows does not allow deleting files held by another process, so the SQLite DB must be closed before t.TempDir() removal runs.
1 parent 228edc7 commit 5fe2b50

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

internal/tools/snippet_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func Run() {
4747
if err != nil {
4848
t.Fatal(err)
4949
}
50+
t.Cleanup(router.CloseAll)
5051

5152
projName := "test-project"
5253
st, err := router.ForProject(projName)

internal/watcher/watcher_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func newTestRouter(t *testing.T, projectName, rootPath string) *store.StoreRoute
1919
if err != nil {
2020
t.Fatal(err)
2121
}
22+
t.Cleanup(r.CloseAll)
2223
if projectName != "" {
2324
st, err := r.ForProject(projectName)
2425
if err != nil {

0 commit comments

Comments
 (0)