time: skip test that will fail with GO111MODULE=off
The test is designed to ensure that behavior introduced in Go 1.23
to garbage collect async timed channels is working correctly. If
GO111MODULE=off is set (or GODEBUG=asynctimerchan=1) Go reverts to the
Go 1.20 behavior of not garbage collecting these channels, which fails
the test.
Instead of running a test in conditions where we know it will fail,
just skip the test. A more comprehensive test does not make sense
right now because this code may go away soon.
Fixes #76948.
diff --git a/src/time/export_test.go b/src/time/export_test.go
index a4940d1..78ce2ad 100644
--- a/src/time/export_test.go
+++ b/src/time/export_test.go
@@ -40,6 +40,7 @@
Tzset = tzset
TzsetName = tzsetName
TzsetOffset = tzsetOffset
+ AsynctimerChan = asynctimerchan
)
func LoadFromEmbeddedTZData(zone string) (string, error) {
diff --git a/src/time/tick_test.go b/src/time/tick_test.go
index dcbbcdb..9b39d28 100644
--- a/src/time/tick_test.go
+++ b/src/time/tick_test.go
@@ -266,6 +266,10 @@
}
func TestTimerGC(t *testing.T) {
+ if AsynctimerChan.Value() == "1" {
+ t.Skip("skipping TestTimerGC with asynctimerchan=1")
+ }
+
run := func(t *testing.T, what string, f func()) {
t.Helper()
t.Run(what, func(t *testing.T) {
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
time: skip test that will fail with GO111MODULE=off
The test is designed to ensure that behavior introduced in Go 1.23
to garbage collect async timed channels is working correctly. If
GO111MODULE=off is set (or GODEBUG=asynctimerchan=1) Go reverts to the
Go 1.20 behavior of not garbage collecting these channels, which fails
the test.
Instead of running a test in conditions where we know it will fail,
just skip the test. A more comprehensive test does not make sense
right now because this code may go away soon.
Fixes #76948.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |