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>
main
Fernando Serboncini 3 months ago committed by GitHub
parent f48cd46662
commit 698e92a761
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      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() {

Loading…
Cancel
Save