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

move allFutureThrowing helper to tests #1037

Merged
merged 6 commits into from
Mar 1, 2024
Merged

Conversation

etan-status
Copy link
Contributor

We use a generically seeming helper to help us track three Future exceptions throughout the entire codebase. Move the helper to tests where it finds more use. The helper has several design flaws that make it incompatible with {.async: (raises).} usage, and has the potential to swallow one of the three exceptions that we track with it.

The semantics should not change in this PR, this is a pure refactoring.

We use a generically seeming helper to help us track three `Future`
exceptions throughout the entire codebase. Move the helper to tests
where it finds more use. The helper has several design flaws that make
it incompatible with `{.async: (raises).}` usage, and has the potential
to swallow one of the three exceptions that we track with it.

The semantics should not change in this PR, this is a pure refactoring.
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 82.77%. Comparing base (53e3825) to head (3ccb5c9).
Report is 2 commits behind head on unstable.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##           unstable    #1037      +/-   ##
============================================
+ Coverage     82.75%   82.77%   +0.01%     
============================================
  Files            91       91              
  Lines         15616    15604      -12     
============================================
- Hits          12923    12916       -7     
+ Misses         2693     2688       -5     
Files Coverage Δ
libp2p/errors.nim 66.66% <ø> (-7.15%) ⬇️
libp2p/stream/lpstream.nim 83.41% <100.00%> (ø)
libp2p/transports/tcptransport.nim 81.05% <100.00%> (+1.49%) ⬆️
libp2p/protocols/secure/secure.nim 71.42% <88.88%> (-1.30%) ⬇️

... and 3 files with indirect coverage changes

@arnetheduck
Copy link
Contributor

this PR I guess is fine:ish but it does introduce a bit of unnecessary churn - it would be more clear if first, one annotated all close functions with raises - this would likely obsolete it entirely as most exceptions it protects against actually can't happen.

@etan-status
Copy link
Contributor Author

Yeah, doing those next, but the problem is allFuturesThrowing doesn't work with {.async: (raises).} as the futures have different raises requirements and it doesn't use FutureBase.

So, getting rid of that problem first allows doing the close transition cleanly. Will do close next.

arnetheduck
arnetheduck previously approved these changes Mar 1, 2024
@etan-status etan-status enabled auto-merge (squash) March 1, 2024 13:35
@etan-status etan-status merged commit 6c87348 into unstable Mar 1, 2024
11 checks passed
@etan-status etan-status deleted the dev/etan/ex-logall branch March 1, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

2 participants