From 3f451f2c54c87db8b8f30e4d5224933f7895f453 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20G=2E=20MARAND?= Date: Wed, 1 Oct 2025 12:46:16 +0000 Subject: [PATCH] testing/synctest: fix inverted test failure message in TestContextAfterFunc Fixes #75685 Change-Id: I5592becfde6aaca3d7f0e2f09bc7a9785228523e GitHub-Last-Rev: 0ff7bd31ecfc23222dae70194621397330f3c2da GitHub-Pull-Request: golang/go#75687 Reviewed-on: https://go-review.googlesource.com/c/go/+/708275 Reviewed-by: Alan Donovan Auto-Submit: Alan Donovan LUCI-TryBot-Result: Go LUCI Auto-Submit: Damien Neil Auto-Submit: Sean Liao Reviewed-by: Damien Neil Reviewed-by: Sean Liao --- src/testing/synctest/example_test.go | 2 +- src/testing/synctest/synctest.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testing/synctest/example_test.go b/src/testing/synctest/example_test.go index 843377ea88..a86d87fcec 100644 --- a/src/testing/synctest/example_test.go +++ b/src/testing/synctest/example_test.go @@ -66,7 +66,7 @@ func TestContextAfterFunc(t *testing.T) { cancel() synctest.Wait() if !afterFuncCalled { - t.Fatalf("before context is canceled: AfterFunc not called") + t.Fatalf("after context is canceled: AfterFunc not called") } }) } diff --git a/src/testing/synctest/synctest.go b/src/testing/synctest/synctest.go index 707383f9c7..9f499515b8 100644 --- a/src/testing/synctest/synctest.go +++ b/src/testing/synctest/synctest.go @@ -147,7 +147,7 @@ // cancel() // synctest.Wait() // if !afterFuncCalled { -// t.Fatalf("before context is canceled: AfterFunc not called") +// t.Fatalf("after context is canceled: AfterFunc not called") // } // }) // } -- 2.52.0