aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/syscall_windows_test.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2023-08-31 09:13:06 +0200
committerGopher Robot <gobot@golang.org>2023-08-31 16:31:35 +0000
commitcab416f3394ee0211f221f5df0a145ddbfd16e5f (patch)
treeaab96b72716608b45f1a2d33976539d54b550fca /src/runtime/syscall_windows_test.go
parent9aaf5234bf652fc788782fc04a06044879b5957a (diff)
downloadgo-cab416f3394ee0211f221f5df0a145ddbfd16e5f.tar.xz
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 <gobot@golang.org> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/runtime/syscall_windows_test.go')
-rw-r--r--src/runtime/syscall_windows_test.go4
1 files changed, 1 insertions, 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: