reflect: remove timeout in TestChanOfGC

This test has an arbitrary 5 second timeout, and this seems to fire on
Darwin with mayMoreStackMove enabled (which is slow). Just rely on the
regular test timeout instead of this arbitrary shorter timeout to
eliminate the possibility that the test is just too slow.

On my Linux VM, I can get this test to take up to 2 seconds with
mayMoreStackMove set on all the same packages dist does, so this failure
mode is actually plausible.

Fixes #75742.

Change-Id: Iebcc859cab26e9205b57b869690162a9a424dfce
Reviewed-on: https://go-review.googlesource.com/c/go/+/710618
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Michael Anthony Knyszek 2025-10-09 21:13:59 +00:00 committed by Michael Knyszek
parent 9db7e30bb4
commit 80f3bb5516

View file

@ -6198,19 +6198,6 @@ func TestChanOfDir(t *testing.T) {
}
func TestChanOfGC(t *testing.T) {
done := make(chan bool, 1)
go func() {
select {
case <-done:
case <-time.After(5 * time.Second):
panic("deadlock in TestChanOfGC")
}
}()
defer func() {
done <- true
}()
type T *uintptr
tt := TypeOf(T(nil))
ct := ChanOf(BothDir, tt)