Skip to content

itest+lntest: harden sweep and watchtower flakes#10715

Merged
yyforyongyu merged 2 commits intolightningnetwork:masterfrom
yyforyongyu:fix/ci-sweep-watchtower-flakes
Apr 27, 2026
Merged

itest+lntest: harden sweep and watchtower flakes#10715
yyforyongyu merged 2 commits intolightningnetwork:masterfrom
yyforyongyu:fix/ci-sweep-watchtower-flakes

Conversation

@yyforyongyu
Copy link
Copy Markdown
Member

Fix the two flakes,

--- FAIL: TestLightningNetworkDaemon/tranche02/114-of-325/bitcoind/watchtower-revoked_close_retribution_altruist (176.15s)
        --- FAIL: TestLightningNetworkDaemon/tranche02/114-of-325/bitcoind/watchtower-revoked_close_retribution_altruist/LEGACY (176.15s)
            harness_node.go:395: Starting node (name=Carol) with PID=73180
            harness_node.go:395: Starting node (name=Willy) with PID=73703
            harness_node.go:395: Starting node (name=Dave) with PID=73974
            harness_node.go:395: Starting node (name=Carol) with PID=74574
            harness.go:1681: 
                	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness.go:1681
                	            				/home/runner/work/lnd/lnd/itest/lnd_watchtower_test.go:456
                	            				/home/runner/work/lnd/lnd/itest/lnd_watchtower_test.go:345
                	            				/home/runner/work/lnd/lnd/lntest/harness.go:320
                	            				/home/runner/work/lnd/lnd/itest/lnd_watchtower_test.go:353
                	            				/opt/hostedtoolcache/go/1.25.5/x64/src/runtime/asm_amd64.s:1693
                	Error:      	Received unexpected error:
                	            	Dave: channel:funding_txid_bytes:"L|\x96\xbf.\xc4\x1fGe\x89\x84\xa1\x85\xfe\xff\xa3\x9dҒ\xe6\xeb7\xe0+MOS\xef\xefY 0" waiting for HTLCs, added: 0/6
                	Test:       	TestLightningNetworkDaemon/tranche02/114-of-325/bitcoind/watchtower-revoked_close_retribution_altruist/LEGACY
                	Messages:   	timeout while waiting for HTLCs to lock in
            harness.go:398: finished test: watchtower-revoked_close_retribution_altruist, start height=880, end height=882, mined blocks=2
            harness.go:357: test failed, skipped cleanup
        lnd_watchtower_test.go:362: Failure time: 2026-04-01 16:45:07.934
        harness.go:398: finished test: watchtower-revoked_close_retribution_altruist, start height=880, end height=882, mined blocks=2
        harness.go:357: test failed, skipped cleanup
    lnd_test.go:152: Failure time: 2026-04-01 16:45:07.935

and

--- FAIL: TestLightningNetworkDaemon/tranche01/79-of-325/bitcoind/sweep_htlcs (131.80s)
        harness_node.go:395: Starting node (name=Alice) with PID=80521
        harness_node.go:395: Starting node (name=Bob) with PID=80935
        harness_node.go:395: Starting node (name=Carol) with PID=81379
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=22): txWeight=1066 wu, want feerate=4525 sat/kw, got feerate=4524 sat/kw, delta=2018 sat/kw in tx 76ed2f9ad1989a20ec7db5c7172193e197fcacd1c6b5330d6f491ceff96eb578
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=21): txWeight=1066 wu, want feerate=6543 sat/kw, got feerate=6543 sat/kw, delta=2018 sat/kw in tx 54dce9450014a94afa969a5a893904316e17838969fc8299b0ad79828243fbfa
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=20): txWeight=1066 wu, want feerate=8561 sat/kw, got feerate=8569 sat/kw, delta=2018 sat/kw in tx 92122774e8b14853c091208873841e75cad16725db30bf4277ed30a22bfc19eb
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=19): txWeight=1066 wu, want feerate=10579 sat/kw, got feerate=10579 sat/kw, delta=2018 sat/kw in tx 9d870940fd3a80bc2f0853c2117ce9c0be5e501be5162ab336ff56c726fee90d
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=18): txWeight=1066 wu, want feerate=12597 sat/kw, got feerate=12597 sat/kw, delta=2018 sat/kw in tx e5830799d0711aa0f8955c5233067e3524c584b1bf1962c09e5f464b1c4b22c3
        lnd_sweep_test.go:962: Bob's Outgoing HTLC (deadline=17): txWeight=1066 wu, want feerate=14615 sat/kw, got feerate=14628 sat/kw, delta=2018 sat/kw in tx c9269b299ddc9253263e9c661e802bb44e3e58907181615d0e97bf334acdac1b
        miner.go:384: 
            	Error Trace:	/home/runner/work/lnd/lnd/lntest/miner/miner.go:384
            	            				/home/runner/work/lnd/lnd/lntest/miner/miner.go:596
            	            				/home/runner/work/lnd/lnd/lntest/harness_miner.go:240
            	            				/home/runner/work/lnd/lnd/itest/lnd_sweep_test.go:1060
            	            				/home/runner/work/lnd/lnd/lntest/harness.go:320
            	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:144
            	Error:      	Received unexpected error:
            	            	-5: No information available about transaction c7fd8b8fddbaad8aab62d749a293a75b4197fd78b9b83c1f0277eb7b5bc323f3
            	Test:       	TestLightningNetworkDaemon/tranche01/79-of-325/bitcoind/sweep_htlcs
            	Messages:   	failed to get raw tx: c7fd8b8fddbaad8aab62d749a293a75b4197fd78b9b83c1f0277eb7b5bc323f3
        harness.go:398: finished test: sweep_htlcs, start height=984, end height=1028, mined blocks=44

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses intermittent test failures in the integration test suite. By introducing more deterministic synchronization points for channel states and implementing a robust polling mechanism for mempool transaction retrieval, the changes harden the test environment against race conditions and transient state inconsistencies.

Highlights

  • Test Stability: Updated revocation and watchtower tests to explicitly wait for channel links to become active, preventing race conditions during node reconnection.
  • Mempool Robustness: Refactored GetNumTxsFromMempool to include a retry mechanism, ensuring that transient mempool changes (such as RBF replacements) do not cause test failures.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the reliability of integration tests by ensuring channel links are active before sending payments and by adding a retry mechanism to GetNumTxsFromMempool to handle RBF-replaced transactions. A minor formatting issue was identified in lntest/miner/miner.go where a newline is needed to separate logical stanzas according to the style guide.

Comment thread lntest/miner/miner.go
Copy link
Copy Markdown
Collaborator

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

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

LGTM

@yyforyongyu yyforyongyu force-pushed the fix/ci-sweep-watchtower-flakes branch from 409f366 to d9c7c81 Compare April 7, 2026 12:29
@lightninglabs-deploy
Copy link
Copy Markdown
Collaborator

@yyforyongyu, remember to re-request review from reviewers when ready

@yyforyongyu yyforyongyu merged commit acb8f1c into lightningnetwork:master Apr 27, 2026
41 of 44 checks passed
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.

3 participants