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

Remove sleepAsync from tests/testswitch #792

Merged
merged 2 commits into from
Oct 27, 2022
Merged

Remove sleepAsync from tests/testswitch #792

merged 2 commits into from
Oct 27, 2022

Conversation

Menduist
Copy link
Contributor

@Menduist Menduist commented Oct 27, 2022

It's flaky

We should aim to remove as many sleepAsync as possible, as they are generally synonyms with flaky tests. Exception being tests actually based on time


var peerId = PeerId.init(PrivateKey.random(ECDSA, rng[]).get()).get()
let connectFut = switch.connect(peerId, transport.addrs)
await sleepAsync(500.millis)
Copy link
Contributor Author

@Menduist Menduist Oct 27, 2022

Choose a reason for hiding this comment

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

This test was not actually testing cancellation since the connect was finished far before 500 milliseconds
This will be tested properly in #611

@Menduist Menduist enabled auto-merge (squash) October 27, 2022 14:35
lchenut
lchenut previously approved these changes Oct 27, 2022
@Menduist Menduist merged commit 4bce8f3 into unstable Oct 27, 2022
@Menduist Menduist deleted the lessflaky branch October 27, 2022 23:10
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