Skip to content

Commit

Permalink
Add better test isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Nov 21, 2024
1 parent e24c960 commit 48fb985
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/real/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,19 +771,26 @@ async fn mutation_requeue_jobs() {
// to ensure there are no left-overs
let local = "mutation_requeue_jobs";
let mut client = Client::connect().await.unwrap();
client
.requeue(
MutationTarget::Retries,
MutationFilter::builder().kind(local).build(),
)
.await
.unwrap();
client.queue_remove(&[local]).await.unwrap();

// prepare a worker that will fail the job unconditionally
let mut worker = Worker::builder::<io::Error>()
.register_fn("rpc_procedure_name", move |_job| async move {
.register_fn(local, move |_job| async move {
panic!("Failure should be recorded");
})
.connect()
.await
.unwrap();

// enqueue a job
let job = JobBuilder::new("rpc_procedure_name").queue(local).build();
let job = JobBuilder::new(local).queue(local).build();
let job_id = job.id().clone();
client.enqueue(job).await.unwrap();

Expand Down Expand Up @@ -823,7 +830,7 @@ async fn mutation_requeue_specific_jobs_only() {
client
.requeue(
MutationTarget::Retries,
MutationFilter::default(), // just an empty filter
MutationFilter::builder().kind(local).build(),
)
.await
.unwrap();
Expand Down

0 comments on commit 48fb985

Please sign in to comment.