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

Fix test flakes that wait for routing events #905

Merged
merged 5 commits into from
Sep 19, 2023

Conversation

iand
Copy link

@iand iand commented Sep 19, 2023

Replaces the routing notification channel with a type that is passed in by the consumer. This allows tests waiting for routing notifications to deterministically buffer and inspect the entire set of notifications.

Tests in DHT package are a little more awkward to write since they have to pass in a RoutingNotifier but we need to do a pass over the test helpers anyway and should clean all of it up with some helper functions.

@iand iand changed the title Fix TestRTAdditionOnSuccessfulQuery test flake on Windows 32-bit Fix test flakes that wait for routing events Sep 19, 2023
@iand iand added the v2 All issues related to the v2 rewrite label Sep 19, 2023
@dennis-tra dennis-tra merged commit b9b0a83 into v2-coord-addr Sep 19, 2023
11 checks passed
@dennis-tra dennis-tra deleted the v2-query-flake-windows branch September 19, 2023 11:07
iand added a commit that referenced this pull request Sep 19, 2023
* Decouple coord package from addressing

* Go fmt

* fix: garbage collection test race condition (#904)

Moved ticker initialization outside the garbage collection goroutine. There was a race condition between advancing the mocked time in TestProvidersBackend_GarbageCollection and the initialization of the ticker that triggers the garbage collection runs. It happened that we were advancing the time without the ticker being initialized. Hence, advancing the time hasn't had any effect.

In this PR, I moved the ticker initialization outside the garbage collection goroutine. This means the ticker will be registered with the MockClock object after StartGarbageCollection returns. Calls to mockClock.Add will therefore trigger the ticker.

* Fix test flakes that wait for routing events (#905)

* Increase test iterations to trigger flake

* Add failfast

* Replace routing notification channel with a RoutingNotifier type

* Remove unused code

* Remove test count

---------

Co-authored-by: Dennis Trautwein <git@dtrautwein.eu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 All issues related to the v2 rewrite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants