Skip to content

Commit

Permalink
runtime: allow for 5 more threads in TestWindowsStackMemory*
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
alexbrainman committed Mar 7, 2023
1 parent b675a75 commit f6cbc1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/runtime/testdata/testprog/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
5 changes: 4 additions & 1 deletion src/runtime/testdata/testprogcgo/stack_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

0 comments on commit f6cbc1d

Please sign in to comment.