From cab416f3394ee0211f221f5df0a145ddbfd16e5f Mon Sep 17 00:00:00 2001 From: qmuntal Date: Thu, 31 Aug 2023 09:13:06 +0200 Subject: [PATCH] runtime: remove unnecessary timeout in TestCallbackInAnotherThread Waiting only for 100ms might be not enough for the callback to be called. It is more reliable to wait infinitely and rely on the test timeout to fail the test if the callback is not called. Fixes #62206 Change-Id: I06b5eadae1dd334a2afc41af31a44b42cb5e596d Reviewed-on: https://go-review.googlesource.com/c/go/+/524695 TryBot-Result: Gopher Robot Run-TryBot: Quim Muntal Reviewed-by: Bryan Mills Reviewed-by: Dmitri Shuralyov Auto-Submit: Quim Muntal Reviewed-by: Alex Brainman --- src/runtime/syscall_windows_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go index 1770b83e5d..6a056c8d2b 100644 --- a/src/runtime/syscall_windows_test.go +++ b/src/runtime/syscall_windows_test.go @@ -265,11 +265,9 @@ func TestCallbackInAnotherThread(t *testing.T) { h := syscall.Handle(r) defer syscall.CloseHandle(h) - switch s, err := syscall.WaitForSingleObject(h, 100); s { + switch s, err := syscall.WaitForSingleObject(h, syscall.INFINITE); s { case syscall.WAIT_OBJECT_0: break - case syscall.WAIT_TIMEOUT: - t.Fatal("timeout waiting for thread to exit") case syscall.WAIT_FAILED: t.Fatalf("WaitForSingleObject failed: %v", err) default: -- 2.50.0