Skip to content

Fix what bolt2_open_channel_sending_node_checks_part1 tests #1317

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

Merged
merged 2 commits into from
Mar 5, 2022

Conversation

TheBlueMatt
Copy link
Collaborator

This is split out from #1311.

There are currently two issues with
bolt2_open_channel_sending_node_checks_part1 which counteract
each other and hide that the test isn't testing what it should be.

First of all, the final create_channel call actually fails
because we try to open a channel with ourselves, instead of
panicing as the test is supposed to check for.

However, when we fix the create_channel call to panic, when we
drop nodes[1] after create_channel panics, we fail the
no-pending-messages test as it as an expeted accept_channel in
its outbound buffer. This causes a double-panic.

Previously, these two offset each other - instead of panicing in
create_channel we'd panic in the Node drop checks.

This fixes both by fetching the accept_channel before we go into
the panic'ing create_channel call (who's arguments were
corrected).

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #1317 (6e776d9) into main (6259e7a) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1317      +/-   ##
==========================================
+ Coverage   90.60%   90.68%   +0.07%     
==========================================
  Files          72       72              
  Lines       40075    41412    +1337     
==========================================
+ Hits        36310    37553    +1243     
- Misses       3765     3859      +94     
Impacted Files Coverage Δ
lightning/src/ln/functional_tests.rs 97.10% <100.00%> (-0.04%) ⬇️
lightning/src/ln/onion_route_tests.rs 97.62% <100.00%> (ø)
lightning/src/util/test_utils.rs 82.42% <100.00%> (-0.02%) ⬇️
lightning/src/routing/scoring.rs 95.31% <0.00%> (+0.27%) ⬆️
lightning/src/ln/channelmanager.rs 86.15% <0.00%> (+1.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6259e7a...6e776d9. Read the comment docs.

@TheBlueMatt
Copy link
Collaborator Author

Took a commit to address #1311 (comment)

There are currently two issues with
`bolt2_open_channel_sending_node_checks_part1` which counteract
each other and hide that the test isn't testing what it should be.

First of all, the final `create_channel` call actually fails
because we try to open a channel with ourselves, instead of
panicing as the test is supposed to check for.

However, when we fix the create_channel call to panic, when we
drop `nodes[1]` after `create_channel` panics, we fail the
no-pending-messages test as it as an expeted `accept_channel` in
its outbound buffer. This causes a double-panic.

Previously, these two offset each other - instead of panicing in
`create_channel` we'd panic in the Node drop checks.

This fixes both by fetching the `accept_channel` before we go into
the panic'ing `create_channel` call (who's arguments were
		corrected).
Its very confusing to have multiple fields that do the same thing,
one of which isn't even used for its stated purpose anymore after
the previous few commits.
@TheBlueMatt TheBlueMatt force-pushed the 2022-02-fix-bunk-test branch from 9c6a377 to 6e776d9 Compare March 4, 2022 21:54
@TheBlueMatt
Copy link
Collaborator Author

Rebased to update upstream changes which were broken by this change.

@TheBlueMatt TheBlueMatt merged commit 0e0aabe into lightningdevkit:main Mar 5, 2022
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