lnd
lnd copied to clipboard
GitHub: use bitcoind v26.0 for CI
Depends on https://github.com/btcsuite/btcd/pull/2071.
Change Description
See if things break in the CI if we update to bitcoind v26.0.
Okay, so the failed unit tests were due to a number of reasons:
bitcoind v26.0doesn't have support for Unix Sockets (ipc://) in ZMQ anymore. Broken by https://github.com/bitcoin/bitcoin/pull/22087, will be fixed by https://github.com/bitcoin/bitcoin/pull/27679- We had frequent TCP listening port collisions, at least when running the tests locally
- We didn't clean up temporary directories for
bitcoindsometimes
I added a couple of commits to address these issues.
Unit tests still failing. One of the itest failures has uncleaned shutdown that still occupying a port, werid
unable to create server: listen tcp 127.0.0.1:6563: bind: address already in use
Yeah, it seems like I have to do some more digging into failures.
[!IMPORTANT]
Auto Review Skipped
Auto reviews are limited to the following labels: llm-review. Please add one of these labels to enable auto reviews.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository.To trigger a single review, invoke the
@coderabbitai reviewcommand.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>.Generate unit-tests for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit tests for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@coderabbitai read src/utils.ts and generate unit tests.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger a review. This is useful when automatic reviews are disabled for the repository.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
@Roasbeef can you see the logs of the failed Travis build? I only get this error message (not sure if we need to re-auth the app somehow?):
@guggero
--- FAIL: TestLightningNetworkDaemon (26.84s)
FAIL
harness_setup.go:45:
Error Trace: /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/harness_setup.go:45
/home/travis/gopath/src/github.com/lightningnetwork/lnd/itest/lnd_test.go:97
Error: Received unexpected error:
invalid http POST response (nil), method: addnode, id: 1, last error=Post "http://127.0.0.1:9561": dial tcp 127.0.0.1:9561: connect: connection refused
Test: TestLightningNetworkDaemon
Messages: connect miner
https://app.travis-ci.com/github/lightningnetwork/lnd/builds/268702896
Yeah, new failures keep popping up that I cannot easily reproduce locally. Or only with spending a lot of time on it, which I haven't found yet. Not sure if this is a priority, @saubyk?
Yeah, new failures keep popping up that I cannot easily reproduce locally. Or only with spending a lot of time on it, which I haven't found yet. Not sure if this is a priority, @saubyk?
I am not aware of any critical dependency on bitcoind v26.0 for our imminent releases, so we can keep this at a lower priority
@bitromortac: review reminder @ellemouton: review reminder @crypt-iq: review reminder @guggero, remember to re-request review from reviewers when ready
Our CI is using bitcoind v23.0, and I think it's very important to test lnd against a newer version of bitcoind, there are new RPCs used but never checked in our CI, also the upcoming sweeper will also need a newer version of bitcoind.
Can take over if needed @guggero
@yyforyongyu feel free to take over! I'm sure the failures are something small, just hard to find with some rounds of debugging required.
cc: @ProofOfKeags for taking this over
So here's what I've found out. The success/failure of the FilteredChainView tests is highly sensitive to whether other unit tests are running as well. This makes me think that our unit test suite somehow doesn't isolate the instances of the bitcoin node it is talking to.
- If I run just the FilteredChainView tests, it always succeeds.
- If I run the tests naively (allowing test caching), it usually succeeds in the limit case. Since only passing tests cache, I suspect that repeatedly running it stabilizes the test because fewer and fewer tests are competing for the same resource each run, reducing the race-y behavior
- If I run the tests with
nocache=1it always fails. - Extending the timeout on the FilteredChainView tests does not seem to have an impact. I increased it from 20s to 30s since the test seems to reliably run in 20s. A 50% boost should be enough if it was truly a time budget issue.
Taking into consideration that this broke by upgrading from Core 23 to Core 26 is more perplexing. I'd expect race-y behavior to not depend on that.
Thank you @ProofOfKeags for investigating! Your insights have given me another idea what the problem might be. The fact that running things in parallel causes the test to fail make me think the "per process unique port" generation mechanism doesn't work as expected. So I changed it to be unique per system, using a single file. Let's see how far that gets us...
Okay, I think I have a version that should work. Wish me luck!
Okay, I fixed a couple of more issues:
- Postgres: Needed to increase the number of allowed connections. Now the "connection not found" should be gone.
- Travis: They seem to filter on the branch name and refuse to build because the word "bitcoin" appears in it. They suck anyway and GitHub now has a macOS build on M1 that we can use for our ARM (
arm64) builds. So I replaced the Travis build with an additional GitHub run (let's see how that one fares). - The sporadic failures in the
routing/chainviewtests were caused by not waiting for the backend node to fully start up. There seems to be an issue with thechain.BitcoindClientthat it can get weirdly de-synchronized ifStart()andNotifyBlocks()are called while the node is syncing with the chain still (if things are very slow and blocks come in betweenStart()andNotifyBlocks(), weird things start to happen). Waiting one second before using a chain backend solved that issue for now.
Things look way better now IMO. There still are a couple of flakes, but I think those were all pre-existing.
Okay, this is as green as it will probably ever get. There are still a couple of (pre-existing!) flakes in there. But I vote to get this merged since they very likely don't have anything to do with bitcoind.
btw can we update our merge rules to exclude the build from macOS?
btw can we update our merge rules to exclude the build from macOS?
It's currently not included in the list of required tests. So merges shouldn't be blocked on it (same for Windows).
FWIW https://github.com/bitcoin/bitcoin/pull/27679 is updated, has two ACKs already, and a review from an LND dev would be helpful to get a merge ;-)