Skip to content

Commit 036d0a9

Browse files
authored
Fix client state test cleanup (#1864)
Closes #1862 <!-- These comments should help create a useful PR message, please delete any remaining comments before opening the PR. --> <!-- If there is no issue number make sure to describe clearly *why* this PR is necessary. --> <!-- Mention open questions, remaining TODOs, if any --> ### This PR: <!-- Describe what this PR adds to this repo and why --> <!-- E.g. --> <!-- * Implements feature 1 --> <!-- * Fixes bug 3 --> 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. <!-- ### This PR does not: --> <!-- Describe what is out of scope for this PR, if applicable. Leave this section blank if it's not applicable --> <!-- This section helps avoid the reviewer having to needlessly point out missing parts --> <!-- * Implement feature 3 because that feature is blocked by Issue 4 --> <!-- * Implement xyz because that is tracked in issue #123. --> <!-- * Address xzy for which I opened issue #456 --> <!-- ### Key places to review: --> <!-- Describe key places for reviewers to pay close attention to --> <!-- * file.rs, `add_integers` function --> <!-- Or directly comment on those files/lines to make it easier for the reviewers --> <!-- ### How to test this PR: --> <!-- Optional, uncomment the above line if this is relevant to your PR --> <!-- If your PR is fully tested through CI there is no need to add this section --> <!-- * E.g. `just test` --> <!-- ### Things tested --> <!-- Anything that was manually tested (that is not tested in CI). --> <!-- E.g. building/running of docker containers. Changes to docker demo, ... --> <!-- Especially mention anything untested, with reasoning and link an issue to resolve this. --> <!-- Complete the following items before creating this PR --> <!-- [ ] Issue linked or PR description mentions why this change is necessary. --> <!-- [ ] PR description is clear enough for reviewers. --> <!-- [ ] Documentation for changes (additions) has been updated (added). --> <!-- [ ] If this is a draft it is marked as "draft". --> <!-- To make changes to this template edit https://github.com/EspressoSystems/.github/blob/main/PULL_REQUEST_TEMPLATE.md -->
2 parents c408e5e + 68060a4 commit 036d0a9

File tree

1 file changed

+5
-1
lines changed
  • node-metrics/src/service/client_state

1 file changed

+5
-1
lines changed

node-metrics/src/service/client_state/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ pub mod tests {
13081308
let (internal_client_message_sender, internal_client_message_receiver) = mpsc::channel(1);
13091309
let (server_message_sender_1, mut server_message_receiver_1) = mpsc::channel(1);
13101310
let (server_message_sender_2, mut server_message_receiver_2) = mpsc::channel(1);
1311-
let _process_internal_client_message_handle = InternalClientMessageProcessingTask::new(
1311+
let mut process_internal_client_message_handle = InternalClientMessageProcessingTask::new(
13121312
internal_client_message_receiver,
13131313
data_state,
13141314
client_thread_state,
@@ -1359,6 +1359,10 @@ pub mod tests {
13591359
voters_1, voters_2
13601360
]))),
13611361
);
1362+
1363+
if let Some(task_handle) = process_internal_client_message_handle.task_handle.take() {
1364+
assert_eq!(task_handle.cancel().await, None);
1365+
}
13621366
}
13631367

13641368
#[async_std::test]

0 commit comments

Comments
 (0)