]> git.feebdaed.xyz Git - 0xmirror/go.git/commitdiff
runtime: improve a log message in TestCleanupLost
authorLin Lin <linlin152@foxmail.com>
Sat, 20 Dec 2025 15:46:30 +0000 (23:46 +0800)
committerMichael Knyszek <mknyszek@google.com>
Tue, 23 Dec 2025 19:03:15 +0000 (11:03 -0800)
Updates #76929

Change-Id: I3951b14ec979b389773f782a0a89f8277c7b9a59
Reviewed-on: https://go-review.googlesource.com/c/go/+/731680
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/mcleanup_test.go

index 5afe85e103670b151b8f8de79da097a5aaab72f5..dfc688a0f20b0b09f5852d0d30d4274ff67b9f21 100644 (file)
@@ -331,9 +331,14 @@ func TestCleanupLost(t *testing.T) {
        }
        wg.Wait()
        runtime.GC()
-       runtime.BlockUntilEmptyCleanupQueue(int64(10 * time.Second))
+       timeout := 10 * time.Second
+       empty := runtime.BlockUntilEmptyCleanupQueue(int64(timeout))
+       if !empty {
+               t.Errorf("failed to drain cleanup queue within %s", timeout)
+       }
+
        if got := int(got.Load()); got != want {
-               t.Errorf("expected %d cleanups to be executed, got %d", got, want)
+               t.Errorf("%d cleanups executed, expected %d", got, want)
        }
 }