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

chore: fix flaky local peer device info test #488

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

EvanHahn
Copy link
Contributor

waitForPeers() has a waitForDeviceInfo option. When enabled, this helper should resolve only after device info is populated.

It had a tricky bug that only manifested some of the time (see example CI failure 1, 2). In some cases, the function could think device info was populated when it wasn't.1

To fix this, I reworked the helper. It now does redundant work but it's now stateless-ish, which should avoid this problem.

Footnotes

  1. Well, that's what I could reproduce locally. The errors on CI are unhelpful (which I hope to fix in Brittle). It's possible a different problem exists on CI that I couldn't repro locally.

`waitForPeers()` has a `waitForDeviceInfo` option. When enabled, this
helper should resolve only after device info is populated.

It had a tricky bug that only manifested some of the time (see
[example CI failure 1][1], [2]). In some cases, the function could
_think_ device info was populated when it wasn't.[^CI]

To fix this, I reworked the helper. It now does redundant work but it's
now stateless-ish, which should avoid this problem.

[^CI]: Well, that's what I could reproduce locally. The errors on CI are
       unhelpful ([which I hope to fix in Brittle][brittle PR]). It's
       possible a different problem exists on CI that I couldn't repro
       locally.

[1]: https://github.com/digidem/mapeo-core-next/actions/runs/7925562783/job/21731451900
[2]: https://github.com/digidem/mapeo-core-next/actions/runs/7965492933/job/21745121763
[brittle PR]: holepunchto/brittle#44
Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great! thanks for tracking that down

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.

None yet

2 participants