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: prepare itest for major refactor #6052

Merged
merged 7 commits into from
Jan 6, 2022

Conversation

yyforyongyu
Copy link
Member

This PR has commits pulled out from #5939 for easier reviewing, only the last 6 commits are new.

Depends on #5756.

@yyforyongyu yyforyongyu changed the title Itest 2 refactor 1 itest: prepare itest for major refactor Dec 4, 2021
@yyforyongyu yyforyongyu added this to the flake hunting szn milestone Dec 4, 2021
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.

Nice refactor, LGTM 🎉

lntest/harness_node.go Show resolved Hide resolved
lntest/harness_node.go Show resolved Hide resolved
lntest/harness_node.go Outdated Show resolved Hide resolved
lntest/harness_node.go Outdated Show resolved Hide resolved
@yyforyongyu yyforyongyu force-pushed the itest-2-refactor-1 branch 2 times, most recently from 7bfc2fe to a4541b4 Compare December 9, 2021 19:08
@lightninglabs-deploy
Copy link

@positiveblue: review reminder

Copy link
Contributor

@positiveblue positiveblue left a comment

Choose a reason for hiding this comment

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

Thank you @yyforyongyu, test suites improvements keep adding up 🍾

lntest/harness_node.go Show resolved Hide resolved
@guggero
Copy link
Collaborator

guggero commented Dec 16, 2021

The RPC middleware itest seems to fail consistently now. Should I take a look or do you already have a hunch what's causing the failure?

@yyforyongyu
Copy link
Member Author

The RPC middleware itest seems to fail consistently now. Should I take a look or do you already have a hunch what's causing the failure?

If you are talking about this one,

lnd_rpc_middleware_interceptor_test.go:407: 
        	Error Trace:	lnd_rpc_middleware_interceptor_test.go:407
        	            				lnd_rpc_middleware_interceptor_test.go:125
        	Error:      	Received unexpected error:
        	            	failed to subscribe to state: rpc error: code = Canceled desc = grpc: the client connection is closing

Yeah it's been fixed in the last PR.

@guggero
Copy link
Collaborator

guggero commented Jan 3, 2022

The RPC interceptor test still seems to fail with failed to subscribe to state: rpc error: code = Canceled desc = grpc: the client connection is closing.
I'm not sure what you mean with "Yeah it's been fixed in the last PR.". Do you mean last commit? Or another PR and this needs to be rebased?

@yyforyongyu
Copy link
Member Author

yyforyongyu commented Jan 4, 2022

The RPC interceptor test still seems to fail with failed to subscribe to state: rpc error: code = Canceled desc = grpc: the client connection is closing. I'm not sure what you mean with "Yeah it's been fixed in the last PR.". Do you mean last commit? Or another PR and this needs to be rebased?

Sorry, I meant in the final PR #5940, in particular this commit.

This PR contains some commits taken from #5939. I'd say it's an "intermediate" PR that exists only for easier reviewing.

@guggero
Copy link
Collaborator

guggero commented Jan 4, 2022

Ah I see. So should we wait with merging this PR? Or add that commit to it so we don't fully break the itests?

@yyforyongyu
Copy link
Member Author

Ah I see. So should we wait with merging this PR? Or add that commit to it so we don't fully break the itests?

Yeah let's wait. Actually I'm kinda stuck here😂 and opinions are appreciated. These itest-related fix has gone quite far than I originally anticipated, and it's challenging to, say, cherry-pick some commits from later PRs so we have a clean build in each PR because the changes are chained. I'm thinking we could focus the itest build results in the final PR just to make sure the flakes are fixed. Meanwhile, we could somehow loosen checking the itest build results in the intermediate PRs? And for the following PR #5939, do you think it's too large? Maybe I should break it down even more?

This commit refactors the long function start() into smaller pieces and
moves commonly used functions into test_common.go.
This commit adds a new struct RPCClients to better handle rpc clients.
A private field, rpc, is added to HarnessNode to prevent direct access
to its clients. Inside RPCClients, all clients are exported in case a
test case need access to a specific client.
This commit adds a new component, harness miner, to the itest. This
newly added component is responsible for checking the mempool and blocks
for the itest.
This commit replaces the old miner with the new HarnessMiner and cleans
harness_node.go by moving methods into the test_common.go.
@guggero
Copy link
Collaborator

guggero commented Jan 5, 2022

I see, it's getting tricky indeed. But I'd rather not keep the itests in a state where they all fail reliably, that would render us completely blind to new bugs being introduced. Instead, I was able to extract the fix into a single commit that you can add to this PR so we can merge it (if nothing else pops up): guggero@dba9ade

@yyforyongyu
Copy link
Member Author

I was able to extract the fix into a single commit that you can add to this PR so we can merge it

Cool cherry-picked.

@guggero guggero merged commit 61bffa7 into lightningnetwork:master Jan 6, 2022
@guggero guggero modified the milestones: flake hunting szn, v0.15.0 Jan 6, 2022
@yyforyongyu yyforyongyu deleted the itest-2-refactor-1 branch January 7, 2022 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants