Skip to content

Commit

Permalink
Update server_state test. Give Faktory time to update stats
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed May 26, 2024
1 parent 76e7b2f commit 3752f46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/real/community.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::{assert_gte, skip_check};
use faktory::{Client, Job, JobBuilder, JobId, Worker, WorkerBuilder, WorkerId};
use serde_json::Value;
use std::{io, sync};
use std::{io, sync, time::Duration};
use tokio::time as tokio_time;

#[tokio::test(flavor = "multi_thread")]
async fn hello_client() {
Expand Down Expand Up @@ -118,6 +119,9 @@ async fn server_state() {
.await
.unwrap();

// let's give Faktory a second to get updated
tokio_time::sleep(Duration::from_secs(1)).await;

// we only pushed 1 job on this queue
let server_state = client.current_info().await.unwrap();
assert_eq!(*server_state.data.queues.get(local).unwrap(), 1);
Expand Down

0 comments on commit 3752f46

Please sign in to comment.