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

Handle read_dir() errors in persister #1943

Merged

Conversation

andrei-21
Copy link
Contributor

No description provided.

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Jan 10, 2023

This LGTM (great catch!), but I genuinely do not understand why CI had failed. It had this output on a single job but I kicked it to see if its reproducible.

 ---- tests::test_if_monitors_is_not_dir stdout ----
Using Block Connection Style: BestBlockFirstReorgsOnlyTip
thread 'tests::test_if_monitors_is_not_dir' panicked at 'assertion failed: persister.read_channelmonitors(nodes[0].keys_manager).is_err()', lightning-persister/src/lib.rs:180:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Failed to remove test persister directory: No such file or directory (os error 2)


failures:
    tests::test_if_monitors_is_not_dir

@andrei-21 andrei-21 force-pushed the feature/handle-read-dir-errors branch from 8d2b1e0 to 7afa230 Compare January 10, 2023 06:18
@codecov-commenter
Copy link

Codecov Report

Base: 90.75% // Head: 90.72% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (7afa230) compared to base (197a47a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1943      +/-   ##
==========================================
- Coverage   90.75%   90.72%   -0.03%     
==========================================
  Files          96       96              
  Lines       50135    50149      +14     
  Branches    50135    50149      +14     
==========================================
- Hits        45498    45496       -2     
- Misses       4637     4653      +16     
Impacted Files Coverage Δ
lightning-persister/src/lib.rs 93.49% <100.00%> (+0.83%) ⬆️
lightning/src/chain/mod.rs 63.63% <0.00%> (-4.55%) ⬇️
lightning/src/chain/onchaintx.rs 94.33% <0.00%> (-1.05%) ⬇️
lightning-net-tokio/src/lib.rs 77.01% <0.00%> (-0.30%) ⬇️
lightning/src/ln/functional_tests.rs 96.97% <0.00%> (-0.14%) ⬇️
lightning/src/chain/channelmonitor.rs 91.03% <0.00%> (-0.05%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@andrei-21
Copy link
Contributor Author

The problem was that the test relied on a preexistence directory, but removed it at the end. So subsequent runs were failing because there were no expected directory anymore.
I fixed it by creating the required directory (and the file) at the beginning of the test.

@TheBlueMatt TheBlueMatt merged commit cd40078 into lightningdevkit:main Jan 10, 2023
@andrei-21 andrei-21 deleted the feature/handle-read-dir-errors branch January 10, 2023 17:48
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.

None yet

4 participants