log/sockstatlog: don't block for more than 5s on shutdown

Fixes tailscale/corp#21618

Signed-off-by: Anton Tolchanov <anton@tailscale.com>
This commit is contained in:
Anton Tolchanov
2024-07-12 17:27:10 +01:00
committed by Anton Tolchanov
parent 9609b26541
commit 5d61d1c7b0
3 changed files with 7 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
package sockstatlog
import (
"context"
"testing"
"github.com/google/go-cmp/cmp"
@@ -28,7 +29,7 @@ func TestResourceCleanup(t *testing.T) {
t.Fatal(err)
}
lg.Write([]byte("hello"))
lg.Shutdown()
lg.Shutdown(context.Background())
}
func TestDelta(t *testing.T) {