Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lntest: shutdown all nodes at end of test #9209

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lntest/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ func (h *HarnessTest) Stop() {
return
}

h.shutdownAllNodes()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, but I'm wondering why the subtest cleanup did not take care of the standby nodes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During a subtest the standby nodes are just reset, meaning their cached numbers (channels, UTXOs and so on) are reset, but the nodes aren't actually terminated. I think this has been this way for a while now, we just never noticed (or we did and didn't investigate).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I just realized we should only shutdown standby nodes here - the non-standbys have already been shut down during the cleanup in subtest

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but there is no shutdownStandbyNodes(), since shutdownNodes just takes a boolean skipStandby.
And if there are no non-standby nodes, shutting down all of them results in the same thing: just shutting down the standby ones.
Or would you like me to add a shutdownStandbyNodes() function?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay double checked, indeed the subtest cleanup missed shutdown of standby nodes if the test succeeded.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think I recalled why I wrongfully removed it in the first place - when the test fails, we'll shut down the node twice, resulting in some error msgs being printed.

Or would you like me to add a shutdownStandbyNodes() function?

Nah I think you are right - there's map that tracks the active node, and we remove it from the map whenever we shut it down, so no need for this func.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I just tried this out by causing a test to fail and I didn't see duplicate or weird error messages... Maybe that was fixed in another way in the meantime?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah likely


close(h.lndErrorChan)

// Stop the fee service.
Expand Down
Loading