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

connmgr: use clock interface #1720

Merged
merged 1 commit into from
Aug 26, 2022
Merged

connmgr: use clock interface #1720

merged 1 commit into from
Aug 26, 2022

Conversation

MarcoPolo
Copy link
Collaborator

Uses a clock interface rather than real time. This lets tests pass a mock clock.

This also fixes the failing tests here: libp2p/go-libp2p-pubsub#498 because that test is timing sensitive and the connmgr did a good job of keeping the conns below the hi mark. That test also used a mock clock for the decayer, but not for the connmgr which could lead to some weird behavior. The test passes if the same mock clock is passed to both the connmgr and decayer.

Also shaves 3s off our test runtime :)

@MarcoPolo MarcoPolo marked this pull request as ready for review August 26, 2022 00:47
@MarcoPolo MarcoPolo merged commit 37f1230 into master Aug 26, 2022
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.

2 participants