]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[release-branch.go1.20] runtime: allow for 5 more threads in TestWindowsStackMemory*
authorAlex Brainman <alex.brainman@gmail.com>
Sat, 4 Mar 2023 03:35:35 +0000 (14:35 +1100)
committerGopher Robot <gobot@golang.org>
Wed, 28 Jun 2023 20:21:58 +0000 (20:21 +0000)
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

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>

src/runtime/testdata/testprog/syscall_windows.go
src/runtime/testdata/testprogcgo/stack_windows.go

index b4b66441b834a41a49b99a45dad1e2c0df049fb0..71bf384dc10a0dfb7ad6277efc7dc8525231f683 100644 (file)
@@ -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))
 }
index 846297a960c4b9ff1328b5cfb7b9cce88abe53c4..0be1126bee93df6245268343b3d0749cfb9675b6 100644 (file)
@@ -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))
 }