libp2p / go-libp2p-pubsub-router

MIT License
22 stars 12 forks source link

Remove arbitrary sleeps from tests #87

Closed iand closed 2 years ago

iand commented 2 years ago

Also speeds up tests locally since most propagation happens in much less than 1 second

iand commented 2 years ago

Updated to use require.Eventually. We lose the ability to abort the test early on a non-expected error and there is an arbitrary 30 second cutoff but it makes the test more deterministic than the arbitrary sleeps.

iand commented 2 years ago

Hmm. Seems my guess of 30s timeout is too low. Would much prefer not to have to make these kinds of guesses.

iand commented 2 years ago

Increased to 5 minutes

iand commented 2 years ago

Still failing. Using require.Eventually doesn't help fix these flakes.

iand commented 2 years ago

Still seems flaky compared with the original change.

marten-seemann commented 2 years ago

Let's use the original change then? Sorry for the confusion.

iand commented 2 years ago

Rebased back to the original. It's not clear to me why require.Eventually performs so poorly when with this version all tests pass within 2 minutes.

iand commented 2 years ago

@marten-seemann