From 3175429d450c7af4dfca6ea790249741c25a2652 Mon Sep 17 00:00:00 2001 From: anim001k <140460766+anim001k@users.noreply.github.com> Date: Thu, 9 Oct 2025 22:18:49 +0200 Subject: [PATCH] Update multilock_test.go --- async/multilock_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/async/multilock_test.go b/async/multilock_test.go index 571460a37386..c06c01576ccd 100644 --- a/async/multilock_test.go +++ b/async/multilock_test.go @@ -234,13 +234,15 @@ func TestClean(t *testing.T) { // this one cleans up the locks every 100 ms done := make(chan bool, 1) go func() { - c := time.Tick(100 * time.Millisecond) + ticker := time.NewTicker(100 * time.Millisecond) + // Ensure ticker is stopped to avoid leaks. + defer ticker.Stop() Loop: for { select { case <-done: break Loop - case <-c: + case <-ticker.C: Clean() } }