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

itest+lntest: speed up test setup #9195

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

yyforyongyu
Copy link
Member

Turns out we are doing 200 GetRawMempool RPC calls when setting up the test case, which is now optimized.

Before this change,

--- PASS: TestLightningNetworkDaemon (68.79s)
    --- PASS: TestLightningNetworkDaemon/tranche00/17-of-174/btcd/list_channels (13.86s)

After this change,

--- PASS: TestLightningNetworkDaemon (29.66s)
    --- PASS: TestLightningNetworkDaemon/tranche00/17-of-174/btcd/list_channels (13.89s)

Also changes the methods so we don't pass pointers of chainhash.Hash anymore in the tests.

Thanks @bitromortac for pointing this out!

This commit fixes the methods used in `lntest` so they stop using
pointers to chainhash.
So we only need to do one `GetRawMempool` lookup when checking the
exclusion of multiple txns.
@yyforyongyu yyforyongyu added optimization itests Issues related to integration tests. size/micro small bug fix or feature, less than 15 mins of review, less than 250 labels Oct 16, 2024
@yyforyongyu yyforyongyu added this to the v0.19.0 milestone Oct 16, 2024
Copy link
Collaborator

@bhandras bhandras left a comment

Choose a reason for hiding this comment

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

Nice! LGTM 🎉

Copy link
Collaborator

@bitromortac bitromortac left a comment

Choose a reason for hiding this comment

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

LGTM 🎉, great improvement for single itest runs, thanks for the investigation!

@@ -342,6 +342,7 @@ func (h *HarnessTest) SetupStandbyNodes() {
// above a good number of confirmations.
const totalTxes = 200
h.MineBlocksAndAssertNumTxes(numBlocksSendOutput, totalTxes)
h.MineBlocks(numBlocksSendOutput)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: may move this change to its own commit, the motivation is not clear

Copy link
Member Author

Choose a reason for hiding this comment

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

it's a mistake...was doing a performance comparison and forgot to remove it🤦🏻
will remove it in my other PRs since it's minor

Comment on lines +321 to +322
// We require the RPC call to be succeeded and won't wait for
// it as it's an unexpected behavior.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: not sure I understand that comment

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems to be copy/paste, appears in a couple of other places. I interpret it as: "this will call ht.t.Fail() if it doesn't succeed, which will abort the test, so we can continue below assuming it didn't fail".

Copy link
Collaborator

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Very nice!

Comment on lines +321 to +322
// We require the RPC call to be succeeded and won't wait for
// it as it's an unexpected behavior.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems to be copy/paste, appears in a couple of other places. I interpret it as: "this will call ht.t.Fail() if it doesn't succeed, which will abort the test, so we can continue below assuming it didn't fail".

@guggero guggero merged commit f46ae2f into lightningnetwork:master Oct 17, 2024
29 of 34 checks passed
@yyforyongyu yyforyongyu deleted the optimize-itest-setup branch October 17, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itests Issues related to integration tests. optimization size/micro small bug fix or feature, less than 15 mins of review, less than 250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants