diff --git a/lntest/harness.go b/lntest/harness.go index ae31ccf04..a264b3c30 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -840,7 +840,7 @@ 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() { +func (n *NetworkHarness) SaveProfilesPages(t *testing.T) { // Only write gorutine dumps if flag is active. if !(*goroutineDump) { return @@ -848,7 +848,8 @@ func (n *NetworkHarness) SaveProfilesPages() { for _, node := range n.activeNodes { if err := saveProfilesPage(node); err != nil { - fmt.Printf("Error: %v\n", err) + t.Logf("Logging follow-up error only, see rest of "+ + "the log for actual cause: %v\n", err) } } } diff --git a/lntest/itest/test_harness.go b/lntest/itest/test_harness.go index dc4585f28..1d88526f9 100644 --- a/lntest/itest/test_harness.go +++ b/lntest/itest/test_harness.go @@ -82,7 +82,7 @@ func (h *harnessTest) Skipf(format string, args ...interface{}) { // the error stack traces it produces. func (h *harnessTest) Fatalf(format string, a ...interface{}) { if h.lndHarness != nil { - h.lndHarness.SaveProfilesPages() + h.lndHarness.SaveProfilesPages(h.t) } stacktrace := errors.Wrap(fmt.Sprintf(format, a...), 1).ErrorStack() diff --git a/lntest/node.go b/lntest/node.go index f9703b7d7..c9e7020f7 100644 --- a/lntest/node.go +++ b/lntest/node.go @@ -1167,7 +1167,8 @@ func (hn *HarnessNode) stop() error { if hn.conn != nil { err := hn.conn.Close() if err != nil { - return fmt.Errorf("error attempting to stop grpc client: %v", err) + return fmt.Errorf("error attempting to stop grpc "+ + "client: %v", err) } }