mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-15 06:11:20 +00:00
consensus: print go routines in failed test
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -410,7 +411,15 @@ func timeoutWaitGroup(t *testing.T, n int, f func(int), css []*ConsensusState) {
|
|||||||
t.Log(cs.GetRoundState())
|
t.Log(cs.GetRoundState())
|
||||||
t.Log("")
|
t.Log("")
|
||||||
}
|
}
|
||||||
|
os.Stdout.Write([]byte("pprof.Lookup('goroutine'):\n"))
|
||||||
pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
|
pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
|
||||||
|
capture()
|
||||||
panic("Timed out waiting for all validators to commit a block")
|
panic("Timed out waiting for all validators to commit a block")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func capture() {
|
||||||
|
trace := make([]byte, 10240000)
|
||||||
|
count := runtime.Stack(trace, true)
|
||||||
|
fmt.Printf("Stack of %d bytes: %s\n", count, trace)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user