From b892bd2acf597425ca98310cdc02839558326e1d Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Mon, 4 Aug 2025 01:20:45 +0300 Subject: [PATCH] resolve failure on tempdir cleanup Signed-off-by: Mohammed Al Sahaf --- modules/logging/netwriter_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/logging/netwriter_test.go b/modules/logging/netwriter_test.go index 776456722..de6cce0af 100644 --- a/modules/logging/netwriter_test.go +++ b/modules/logging/netwriter_test.go @@ -345,6 +345,12 @@ func TestNetWriter_WALPersistence(t *testing.T) { if err != nil { t.Fatalf("Failed to open writer: %v", err) } + // close on the cleanup to allow the `*testing.T` to remove the temp dir + t.Cleanup(func() { + if err := writer1.Close(); err != nil { + t.Logf("Error closing writer1: %v", err) + } + }) firstMessages := []string{ "Persistent message 1\n",