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:
Oliver Gugger 2021-07-13 18:12:32 +02:00
parent b149a090df
commit 5cabd980b1
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
3 changed files with 6 additions and 4 deletions

View File

@ -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)
}
}
}

View File

@ -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()

View File

@ -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)
}
}