diff --git a/lntest/harness.go b/lntest/harness.go index 210af104b..317271c23 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -652,6 +652,11 @@ func (n *NetworkHarness) StopNode(node *HarnessNode) error { // SaveProfilesPages hits profiles pages of all active nodes and writes it to // disk using a similar naming scheme as to the regular set of logs. func (n *NetworkHarness) SaveProfilesPages() { + // Only write gorutine dumps if flag is active. + if !(*goroutineDump) { + return + } + for _, node := range n.activeNodes { if err := saveProfilesPage(node); err != nil { fmt.Println(err) diff --git a/lntest/node.go b/lntest/node.go index b01a175fe..53caec466 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -80,7 +80,12 @@ var ( // logOutput is a flag that can be set to append the output from the // seed nodes to log files. logOutput = flag.Bool("logoutput", false, - "log output from node n to file outputn.log") + "log output from node n to file output-n.log") + + // goroutineDump is a flag that can be set to dump the active + // goroutines of test nodes on failure. + goroutineDump = flag.Bool("goroutinedump", false, + "write goroutine dump from node n to file pprof-n.log") ) // generateListeningPorts returns three ints representing ports to listen on