Skip to content

Commit 16b1985

Browse files
alexbrainmangopherbot
authored andcommitted
[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 <[email protected]> Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Cherry Mui <[email protected]> (cherry picked from commit f6cbc1d) Reviewed-on: https://go-review.googlesource.com/c/go/+/506975 Run-TryBot: Michael Knyszek <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> (cherry picked from commit 08a58dd) Reviewed-on: https://go-review.googlesource.com/c/go/+/506976 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 9a2e6c9 commit 16b1985

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/runtime/testdata/testprog/syscall_windows.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@ func StackMemory() {
6666
if err != nil {
6767
panic(err)
6868
}
69-
print((mem2 - mem1) / threadCount)
69+
// assumes that this process creates 1 thread for each
70+
// thread locked goroutine plus extra 5 threads
71+
// like sysmon and others
72+
print((mem2 - mem1) / (threadCount + 5))
7073
}

src/runtime/testdata/testprogcgo/stack_windows.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,8 @@ func StackMemory() {
5050
if err != nil {
5151
panic(err)
5252
}
53-
print((mem2 - mem1) / threadCount)
53+
// assumes that this process creates 1 thread for each
54+
// thread locked goroutine plus extra 5 threads
55+
// like sysmon and others
56+
print((mem2 - mem1) / (threadCount + 5))
5457
}

0 commit comments

Comments
 (0)