Revert "runtime: make NumGoroutine and Stack agree not to include system goroutines"

This reverts commit c5bafc8281.

Change-Id: Ie7030c978c6263b9e996d5aa0e490086796df26d
Reviewed-on: https://go-review.googlesource.com/18431
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2016-01-08 15:31:09 +00:00
parent c5bafc8281
commit 6da608206c
5 changed files with 1 additions and 47 deletions

View file

@ -9,7 +9,6 @@ import (
"net"
"runtime"
"runtime/debug"
"strings"
"sync"
"sync/atomic"
"syscall"
@ -337,23 +336,6 @@ func TestGCFairness(t *testing.T) {
}
}
func TestNumGoroutine(t *testing.T) {
output := runTestProg(t, "testprog", "NumGoroutine")
want := "1\n"
if output != want {
t.Fatalf("want %q, got %q", want, output)
}
buf := make([]byte, 1<<20)
buf = buf[:runtime.Stack(buf, true)]
n := runtime.NumGoroutine()
if nstk := strings.Count(string(buf), "goroutine "); n != nstk {
t.Fatalf("NumGoroutine=%d, but found %d goroutines in stack dump", n, nstk)
}
}
func TestPingPongHog(t *testing.T) {
if testing.Short() {
t.Skip("skipping in -short mode")