mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
lntest: make it clear that profile failure is follow-up error
From the error in the itest output log it is not clear whether scraping the profile page caused a test to fail or whether it was just a follow-up error. We make it a bit more clear with an added message.
This commit is contained in:
@@ -840,7 +840,7 @@ func (n *NetworkHarness) StopNode(node *HarnessNode) error {
|
|||||||
|
|
||||||
// SaveProfilesPages hits profiles pages of all active nodes and writes it to
|
// 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.
|
// 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.
|
// Only write gorutine dumps if flag is active.
|
||||||
if !(*goroutineDump) {
|
if !(*goroutineDump) {
|
||||||
return
|
return
|
||||||
@@ -848,7 +848,8 @@ func (n *NetworkHarness) SaveProfilesPages() {
|
|||||||
|
|
||||||
for _, node := range n.activeNodes {
|
for _, node := range n.activeNodes {
|
||||||
if err := saveProfilesPage(node); err != nil {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -82,7 +82,7 @@ func (h *harnessTest) Skipf(format string, args ...interface{}) {
|
|||||||
// the error stack traces it produces.
|
// the error stack traces it produces.
|
||||||
func (h *harnessTest) Fatalf(format string, a ...interface{}) {
|
func (h *harnessTest) Fatalf(format string, a ...interface{}) {
|
||||||
if h.lndHarness != nil {
|
if h.lndHarness != nil {
|
||||||
h.lndHarness.SaveProfilesPages()
|
h.lndHarness.SaveProfilesPages(h.t)
|
||||||
}
|
}
|
||||||
|
|
||||||
stacktrace := errors.Wrap(fmt.Sprintf(format, a...), 1).ErrorStack()
|
stacktrace := errors.Wrap(fmt.Sprintf(format, a...), 1).ErrorStack()
|
||||||
|
@@ -1167,7 +1167,8 @@ func (hn *HarnessNode) stop() error {
|
|||||||
if hn.conn != nil {
|
if hn.conn != nil {
|
||||||
err := hn.conn.Close()
|
err := hn.conn.Close()
|
||||||
if err != nil {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user