Fix slow test telemetry.all_peers_use_single_request_cache #3677
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
And rename it to telemetry.cache_read_and_timeout.
The test was broken because it did a sleep for 7 seconds.
In unit tests, any waiting should be done with ASSERT_TIMELY, or something
similar, so that the system's poll() function is called regularly.
In this case, the poll() function wasn't called for 7 seconds, which
caused things to timeout and comms to be disrupted. The solution was to
replace the sleep with an ASSERT_TIMELY.