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 <fserb@tailscale.com>
This commit is contained in:
Fernando Serboncini
2026-01-30 14:18:45 -05:00
committed by GitHub
parent f48cd46662
commit 698e92a761
+2
View File
@@ -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() {