mirror of
https://github.com/golang/go
synced 2024-11-17 23:34:52 -07:00
runtime/pprof: shorten a few tests
For #10571. Change-Id: I4bdad64e2dfd692ef2adccf2e5e82e9b1996a8ea Reviewed-on: https://go-review.googlesource.com/18206 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com>
This commit is contained in:
parent
83746fd55a
commit
9d549b5b62
@ -311,7 +311,11 @@ func TestGoroutineSwitch(t *testing.T) {
|
|||||||
// Test that profiling of division operations is okay, especially on ARM. See issue 6681.
|
// Test that profiling of division operations is okay, especially on ARM. See issue 6681.
|
||||||
func TestMathBigDivide(t *testing.T) {
|
func TestMathBigDivide(t *testing.T) {
|
||||||
testCPUProfile(t, nil, func() {
|
testCPUProfile(t, nil, func() {
|
||||||
t := time.After(5 * time.Second)
|
duration := 5 * time.Second
|
||||||
|
if testing.Short() {
|
||||||
|
duration = 200 * time.Millisecond
|
||||||
|
}
|
||||||
|
t := time.After(duration)
|
||||||
pi := new(big.Int)
|
pi := new(big.Int)
|
||||||
for {
|
for {
|
||||||
for i := 0; i < 100; i++ {
|
for i := 0; i < 100; i++ {
|
||||||
@ -336,7 +340,11 @@ func TestStackBarrierProfiling(t *testing.T) {
|
|||||||
if runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" {
|
if runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" {
|
||||||
t.Skip("gcstackbarrierall doesn't work on ppc64")
|
t.Skip("gcstackbarrierall doesn't work on ppc64")
|
||||||
}
|
}
|
||||||
cmd := exec.Command(os.Args[0], "-test.run=TestStackBarrierProfiling")
|
args := []string{"-test.run=TestStackBarrierProfiling"}
|
||||||
|
if testing.Short() {
|
||||||
|
args = append(args, "-test.short")
|
||||||
|
}
|
||||||
|
cmd := exec.Command(os.Args[0], args...)
|
||||||
cmd.Env = append([]string{"GODEBUG=gcstackbarrierall=1", "GOGC=1"}, os.Environ()...)
|
cmd.Env = append([]string{"GODEBUG=gcstackbarrierall=1", "GOGC=1"}, os.Environ()...)
|
||||||
if out, err := cmd.CombinedOutput(); err != nil {
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
t.Fatalf("subprocess failed with %v:\n%s", err, out)
|
t.Fatalf("subprocess failed with %v:\n%s", err, out)
|
||||||
@ -349,7 +357,7 @@ func TestStackBarrierProfiling(t *testing.T) {
|
|||||||
// two samples in stackBarrier.
|
// two samples in stackBarrier.
|
||||||
duration := 5 * time.Second
|
duration := 5 * time.Second
|
||||||
if testing.Short() {
|
if testing.Short() {
|
||||||
duration = 1 * time.Second
|
duration = 200 * time.Millisecond
|
||||||
}
|
}
|
||||||
t := time.After(duration)
|
t := time.After(duration)
|
||||||
for {
|
for {
|
||||||
|
Loading…
Reference in New Issue
Block a user