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 client state test cleanup #1864

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

Ayiga
Copy link
Member

@Ayiga Ayiga commented Aug 14, 2024

Closes #1862

This PR:

Adds a cleanup step to the test_process_client_handling_stream_request_latest_voters_snapshot function in order to ensure that a panic! can be avoided in the test cleanup.

The test `test_process_client_handling_stream_request_latest_voters_snapshot`
occasionally fails currently in an inconsistent manner.  This tests doesn't match the
cleanup steps of the other tests.  As a result it makes this test susceptible to async
task scheduling differences between runs.

In general the tasks being tested are considered "critical" and so such failures need
to result in a `panic!` if they occur.  However, with async-std's tasks such panics
cannot be easily intercepted / caught, especially with how they are spawned by the
program with `InternalClientMessageProcessingTask::new`.  So if the channels that
supply the task with the information coming in get `drop`ed and then the task attempts
to consume them, a panic will result.

The solution to this is to cancel the task as part of the test before the channels are
dropped.  This will ensure that the task itself no longer gets scheduled, and the
panic is avoided.
@sveitser
Copy link
Collaborator

CI run for ubuntu non-nix job: https://github.com/EspressoSystems/espresso-sequencer/actions/runs/10388163442

This doesn't run on PRs.

@Ayiga Ayiga merged commit 036d0a9 into main Aug 14, 2024
16 checks passed
@Ayiga Ayiga deleted the ts/fix/latest-voters-snapshot-more-reliable branch August 14, 2024 16:15
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.

Investigate flaky test_process_client_handling_stream_request_latest_voters_snapshot test
2 participants