From: Alex Brainman Date: Sat, 4 Mar 2023 03:35:35 +0000 (+1100) Subject: runtime: allow for 5 more threads in TestWindowsStackMemory* X-Git-Tag: go1.21rc1~1359 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f6cbc1da05da141a78ee33954b52d17642c95130;p=gostls13.git runtime: allow for 5 more threads in TestWindowsStackMemory* Original version of TestWindowsStackMemory did not consider sysmon and other threads running during the test. Allow for 5 extra threads in this test - this should cover any new threads in the future. Fixes #58570 Change-Id: I215790f9b94ff40a32ddd7aa54af715d1dc391c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/473415 Reviewed-by: Michael Pratt Run-TryBot: Alex Brainman TryBot-Result: Gopher Robot Reviewed-by: Cherry Mui --- diff --git a/src/runtime/testdata/testprog/syscall_windows.go b/src/runtime/testdata/testprog/syscall_windows.go index b4b66441b8..71bf384dc1 100644 --- a/src/runtime/testdata/testprog/syscall_windows.go +++ b/src/runtime/testdata/testprog/syscall_windows.go @@ -66,5 +66,8 @@ func StackMemory() { if err != nil { panic(err) } - print((mem2 - mem1) / threadCount) + // assumes that this process creates 1 thread for each + // thread locked goroutine plus extra 5 threads + // like sysmon and others + print((mem2 - mem1) / (threadCount + 5)) } diff --git a/src/runtime/testdata/testprogcgo/stack_windows.go b/src/runtime/testdata/testprogcgo/stack_windows.go index 846297a960..0be1126bee 100644 --- a/src/runtime/testdata/testprogcgo/stack_windows.go +++ b/src/runtime/testdata/testprogcgo/stack_windows.go @@ -50,5 +50,8 @@ func StackMemory() { if err != nil { panic(err) } - print((mem2 - mem1) / threadCount) + // assumes that this process creates 1 thread for each + // thread locked goroutine plus extra 5 threads + // like sysmon and others + print((mem2 - mem1) / (threadCount + 5)) }