vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
242 stars 52 forks source link

use `race` instead of `or` to avoid lockup #1042

Closed etan-status closed 4 months ago

etan-status commented 4 months ago

or futures are currently bugged when using cancelAndWait on them. This sometimes show when tests run several minutes longer until the mess is unstucked through a timeout that pokes the machinery again. Use race to avoid the lockup.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.82%. Comparing base (6c87348) to head (836a954).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042/graphs/tree.svg?width=650&height=150&src=pr&token=UR5JRQ249W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) ```diff @@ Coverage Diff @@ ## unstable #1042 +/- ## ============================================ + Coverage 82.77% 82.82% +0.04% ============================================ Files 91 91 Lines 15604 15613 +9 ============================================ + Hits 12916 12931 +15 + Misses 2688 2682 -6 ``` | [Files](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [libp2p/muxers/yamux/yamux.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL211eGVycy95YW11eC95YW11eC5uaW0=) | `88.40% <100.00%> (+0.06%)` | :arrow_up: | | [libp2p/protocols/connectivity/relay/utils.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9jb25uZWN0aXZpdHkvcmVsYXkvdXRpbHMubmlt) | `96.55% <100.00%> (+0.12%)` | :arrow_up: | | [libp2p/protocols/secure/secure.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvc2VjdXJlLm5pbQ==) | `76.03% <100.00%> (+4.60%)` | :arrow_up: | | [libp2p/transports/tcptransport.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3RyYW5zcG9ydHMvdGNwdHJhbnNwb3J0Lm5pbQ==) | `81.34% <100.00%> (+0.29%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1042/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)