From: Lin Lin Date: Sat, 20 Dec 2025 15:46:30 +0000 (+0800) Subject: runtime: improve a log message in TestCleanupLost X-Git-Tag: go1.26rc2~7^2~39 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=43ebed88cc661e37bf01d5336b5de13fba6e51c7;p=gostls13.git runtime: improve a log message in TestCleanupLost Updates #76929 Change-Id: I3951b14ec979b389773f782a0a89f8277c7b9a59 Reviewed-on: https://go-review.googlesource.com/c/go/+/731680 Reviewed-by: Austin Clements Reviewed-by: Michael Knyszek Reviewed-by: Keith Randall LUCI-TryBot-Result: Go LUCI --- diff --git a/src/runtime/mcleanup_test.go b/src/runtime/mcleanup_test.go index 5afe85e103..dfc688a0f2 100644 --- a/src/runtime/mcleanup_test.go +++ b/src/runtime/mcleanup_test.go @@ -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) } }