From 698e92a761d7a0d95f6b9929c2654f565b219793 Mon Sep 17 00:00:00 2001 From: Fernando Serboncini Date: Fri, 30 Jan 2026 14:18:45 -0500 Subject: [PATCH] logtail/filch: close Filch instances in TestConcurrentSameFile (#18571) On Windows, TempDir cleanup fails if file handles are still open. TestConcurrentSameFile wasn't closing Filch instances before exit Fixes #18570 Signed-off-by: Fernando Serboncini --- logtail/filch/filch_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logtail/filch/filch_test.go b/logtail/filch/filch_test.go index 3c7ba03ca..2538233cf 100644 --- a/logtail/filch/filch_test.go +++ b/logtail/filch/filch_test.go @@ -388,7 +388,9 @@ func testMaxFileSize(t *testing.T, replaceStderr bool) { func TestConcurrentSameFile(t *testing.T) { filePrefix := filepath.Join(t.TempDir(), "testlog") f1 := must.Get(New(filePrefix, Options{MaxFileSize: 1000})) + defer f1.Close() f2 := must.Get(New(filePrefix, Options{MaxFileSize: 1000})) + defer f2.Close() var group sync.WaitGroup for _, f := range []*Filch{f1, f2} { group.Go(func() {