8000 Fixes faulty test logic for the circular buffer channel. by horned-sphere · Pull Request #677 · swimos/swim-rust · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes faulty test logic for the circular buffer channel. #677

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

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion swimos_utilities/swimos_sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ swimos_num = { workspace = true }

[dev-dependencies]
futures = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "sync"] }
9 changes: 5 additions & 4 deletions swimos_utilities/swimos_sync/src/circular_buffer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use crate::circular_buffer::error::{RecvError, SendError};
use crate::circular_buffer::{InternalQueue, OneItemQueue, LARGE_BOUNDARY};
use futures::future::join;
use futures::task::ArcWake;
use futures::StreamExt;
use std::future::Future;
Expand Down Expand Up @@ -183,6 +184,7 @@ async fn receive_several_stream(n: usize) {
for i in 0..n {
assert!(tx.try_send(i).is_ok());
}
tx
};

let recv_task = async move {
Expand All @@ -194,8 +196,9 @@ async fn receive_several_stream(n: usize) {
let send_handle = tokio::spawn(send_task);
let recv_handle = tokio::spawn(recv_task);

assert!(send_handle.await.is_ok());
assert!(recv_handle.await.is_ok());
let (send_result, recv_result) = join(send_handle, recv_handle).await;
assert!(send_result.is_ok());
assert!(recv_result.is_ok());
}

#[tokio::test(flavor = "multi_thread")]
Expand All @@ -204,8 +207,6 @@ async fn small_receive_several_stream() {
}

#[tokio::test(flavor = "multi_thread")]
#[ignore]
// todo: spuriously failing on CI
async fn large_receive_several_stream() {
receive_several_stream(LARGE_BOUNDARY + 1).await;
}
Expand Down
Loading
0