Replies: 1 comment
-
Thanks @seetadev for elaborating on testing issues and future goals. I will push both tests for now and create an issue for this, along with a pull request adding backoff and retries. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@sukhman-sukh : awesome progress so far! 🙌
Fantastic job digging into the tests and improving robustness. Just wanted to capture our latest discussion around the test cases for connected peers, concurrency limits with
trio.CapacityLimiter
, and possible extensions around retry/backoff logic.Here’s a recap of the test goals, strategies, and how we can move forward:
Test 1: Connected Peers Only
You're spot on: the old code used
host.get_peerstore().peer_ids()
, which included stale peers. Your change tohost.get_connected_peers()
is the correct behavior.Goal: Ensure only actively connected peers are used in operations.
Suggested test:
Create a test that:
get_connected_peers()
are acted uponTest 2:
trio.CapacityLimiter
— Bounded ConcurrencyYou're right — there’s no timeout or failure expected here. The test isn’t about catching errors but verifying that concurrency is being limited as intended.
Suggested Strategy:
Mock or wrap the push function to:
0.2s
)Launch 30+ push operations
Track the number of concurrent calls using a shared counter or async-safe logger
Assert: No more than 10 concurrent calls are in flight at any time
This helps us ensure the queueing behavior under load is working as expected.
Optional: Timeout or Retry/Backoff Logic
You're right again: the current logic just queues requests — it doesn’t timeout or back off.
If we want retry or backoff in the future, we’d need to:
Not required right now, but definitely something we can track as a future enhancement.
Next Steps:
get_connected_peers()
usageThanks again for all the thoughtful work here. Let us know if you'd like help mocking any parts of the test or if you want to pair on verifying concurrency under test conditions.
Beta Was this translation helpful? Give feedback.
All reactions