Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

feat: use a clock interface to better support testing for pstoremem #199

Merged
merged 1 commit into from
May 26, 2022

Conversation

MarcoPolo
Copy link
Contributor

Necessary to fix some of the flaky tests in go-libp2p. For example libp2p/go-libp2p#1523 is flaky because we assume that right after we disconnect a peer and check the addrs less than 500ms has elapsed. Of course in a normal environment that's a fine assumption, but in these CI environments relying on things generally happening in a certain amount of time leads to flaky test results.

This also has the added benefit that things don't have to sleep to test the passage of time, they can increment the mock clock. (Didn't update the test suite since I didn't want to update pstoreds version).

@marten-seemann
Copy link
Contributor

This also has the added benefit that things don't have to sleep to test the passage of time, they can increment the mock clock. (Didn't update the test suite since I didn't want to update pstoreds version).

We probably should do this, if we want to consolidate this repo as well (libp2p/go-libp2p#1556). Doesn't need to be in this PR though.

@MarcoPolo MarcoPolo merged commit 3bf1f8c into master May 26, 2022
@MarcoPolo MarcoPolo deleted the marco/with-clock branch May 26, 2022 21:43
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants