diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2023-03-04 14:35:35 +1100 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-06-28 20:54:33 +0000 |
commit | 16b198519bba9fefbf153f33d1fc198229b8c35c (patch) | |
tree | 4dd35b1cc2bf0489cfeb6bc65620695b969d3c6c | |
parent | 9a2e6c9cc2ffa970b8ac5ecf0ea272415e1d9e03 (diff) | |
download | go-16b198519bba9fefbf153f33d1fc198229b8c35c.tar.gz go-16b198519bba9fefbf153f33d1fc198229b8c35c.zip |
[release-branch.go1.19] 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.
For #58570
Fixes #61054
Change-Id: I215790f9b94ff40a32ddd7aa54af715d1dc391c6
Reviewed-on: https://go-review.googlesource.com/c/go/+/473415
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
(cherry picked from commit f6cbc1da05da141a78ee33954b52d17642c95130)
Reviewed-on: https://go-review.googlesource.com/c/go/+/506975
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit 08a58dd8b6337c9bac93face4c386a918a3dd97b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/506976
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
-rw-r--r-- | src/runtime/testdata/testprog/syscall_windows.go | 5 | ||||
-rw-r--r-- | src/runtime/testdata/testprogcgo/stack_windows.go | 5 |
2 files changed, 8 insertions, 2 deletions
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)) } |