Skip to content
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
91 changes: 10 additions & 81 deletions src/pubsub/src/publisher/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ mod tests {
generated::gapic_dataplane::client::Publisher as GapicPublisher,
model::{Message, PublishResponse},
};
use google_cloud_test_macros::tokio_test_no_panics;
use mockall::Sequence;
use rand::{RngExt, distr::Alphanumeric};
use std::collections::VecDeque;
Expand Down Expand Up @@ -720,15 +721,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn concurrent_actor_publish() -> anyhow::Result<()> {
let mut mock = MockGapicPublisherWithFuture::new();
mock.expect_publish()
Expand Down Expand Up @@ -764,15 +757,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn sequential_actor_publish() -> anyhow::Result<()> {
let (msg_seq_tx, mut msg_seq_rx) = unbounded_channel::<Message>();
let mut mock = MockGapicPublisherWithFuture::new();
Expand Down Expand Up @@ -813,15 +798,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn concurrent_actor_flush() -> anyhow::Result<()> {
let mut mock = MockGapicPublisherWithFuture::new();
mock.expect_publish()
Expand Down Expand Up @@ -865,15 +842,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn sequential_actor_flush() -> anyhow::Result<()> {
let (msg_seq_tx, mut msg_seq_rx) = unbounded_channel::<Message>();
let mut mock = MockGapicPublisherWithFuture::new();
Expand Down Expand Up @@ -939,15 +908,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn sequential_actor_resume() -> anyhow::Result<()> {
let (msg_seq_tx, mut msg_seq_rx) = unbounded_channel::<Message>();
let mut mock = MockGapicPublisherWithFuture::new();
Expand Down Expand Up @@ -1012,15 +973,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn concurrent_actor_batch_message_count_threshold() -> anyhow::Result<()> {
let mut mock = MockGapicPublisher::new();
mock.expect_publish()
Expand All @@ -1045,15 +998,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn sequential_actor_batch_message_count_threshold() -> anyhow::Result<()> {
let mut mock = MockGapicPublisher::new();
mock.expect_publish()
Expand All @@ -1077,15 +1022,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn concurrent_actor_byte_count_threshold() -> anyhow::Result<()> {
let mut mock = MockGapicPublisher::new();
mock.expect_publish()
Expand Down Expand Up @@ -1124,15 +1061,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn sequential_actor_byte_count_threshold() -> anyhow::Result<()> {
let mut mock = MockGapicPublisher::new();
mock.expect_publish()
Expand Down
21 changes: 3 additions & 18 deletions src/pubsub/src/publisher/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ mod tests {
publisher::actor::BundledMessage,
publisher::batch::{Batch, BatchingOptions},
};
use google_cloud_test_macros::tokio_test_no_panics;
use tokio::task::JoinSet;

mockall::mock! {
Expand All @@ -154,15 +155,7 @@ mod tests {
}
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn test_push_and_flush_batch() -> anyhow::Result<()> {
let mut batch = Batch::new("topic".len() as u32, BatchingOptions::default());
assert!(batch.is_empty());
Expand Down Expand Up @@ -192,15 +185,7 @@ mod tests {
Ok(())
}

#[cfg_attr(
tokio_unstable,
tokio::test(
start_paused = true,
flavor = "current_thread",
unhandled_panic = "shutdown_runtime"
)
)]
#[cfg_attr(not(tokio_unstable), tokio::test(start_paused = true))]
#[tokio_test_no_panics(start_paused = true)]
async fn test_size() -> anyhow::Result<()> {
use std::collections::HashMap;

Expand Down
Loading
Loading