Skip to content

Improve e2e test CI reliability - #301

Open
benthecarman wants to merge 4 commits into
lightningdevkit:mainfrom
benthecarman:fix-e2e-ci-reliability
Open

benthecarman wants to merge 4 commits into
lightningdevkit:mainfrom
benthecarman:fix-e2e-ci-reliability

Conversation

@benthecarman

Copy link
Copy Markdown
Collaborator

Few things codex found to improve the e2e test reliability on CI:

  • Keep test listeners outside the ephemeral range and prevent port reuse
    within a test process.
  • Give PostgreSQL fixtures unique table names across test processes so
    reusing a port does not reuse database state.
  • Fix handling for force close test
  • Wait before funding tx broadcast before trying to fund a channel
  • Better amount comparison in postgres restart test

@ldk-reviews-bot

ldk-reviews-bot commented Sep 29, 2026 •

Copy link
Copy Markdown

👋 Thanks for assigning @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@f3r10 f3r10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Just one comment, about keeping both ports reserved until the child is ready to take them over.

Comment thread e2e-tests/src/lib.rs
std::fs::write(&config_path, &config_content).unwrap();

// Keep both ports reserved until the child is ready to take them over.
drop((grpc_listener, p2p_listener));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure the comment above matches the code.

It says both ports stay reserved until the child is ready to take them over. The listeners are dropped first, and only then does spawn_server_process start ldk-server. After that drop, is anything still holding the ports, or are they free until the child binds them?

I ran the end-to-end tests and they passed, so I can't show that this gap causes a failure. I just want to check whether the comment describes what the code does.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks fixed

Keep test listeners outside the ephemeral range and prevent port reuse
within a test process. Fail promptly when a server exits during startup
and reap children even when initialization fails.

Give PostgreSQL fixtures unique table names across test processes so
reusing a port does not reuse database state.

AI assistance: OpenAI Codex.
Keep a second channel open so LDK Node does not reconnect the peer while
its force-close notification is being delivered. Require the exact local
and remote closure reasons and verify the other channel stays usable.

Wait for funding and both channels to be usable before closing, then
observe closure events before mining. Remove the alternate processing
error handling from the test.

AI assistance: OpenAI Codex.
Channel opening returns before its funding transaction is broadcast.
Wait for the transaction before mining announcement confirmations, then
require that exact channel to be usable on both peers. Existing channels
must not satisfy readiness for a newly opened channel.

Include routing updates in gossip timeout diagnostics.

AI assistance: OpenAI Codex.
An already-claimed HTLC can leave the commitment during restart,
lowering the closing fee and increasing the claimable balance by the
same amount. Compare exact funds per channel including that fee after
outstanding outgoing claims resolve, while retaining the crash-recovery
scenario.

Cover the observed 43-satoshi fee change and ensure a one-satoshi loss
still fails the funds comparison.

AI assistance: OpenAI Codex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants