Skip to content

Commit

Permalink
Make queue control tests use newly introduced Client::current_info
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed May 26, 2024
1 parent 3c966bd commit d896e64
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/real/community.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ async fn queue_control_actions() {
assert!(rx.try_recv().is_ok());

// let's inspect the sever state
let server_state = client.info().await.unwrap();
let queues = &server_state.get("faktory").unwrap().get("queues").unwrap();
let server_state = client.current_info().await.unwrap();
let queues = &server_state.data.queues;
assert_eq!(*queues.get(local_1).unwrap(), 1); // 1 job remaining
assert_eq!(*queues.get(local_2).unwrap(), 1); // also 1 job remaining

Expand All @@ -351,8 +351,8 @@ async fn queue_control_actions() {
assert!(!rx.try_recv().is_ok());

// let's inspect the sever state again
let server_state = client.info().await.unwrap();
let queues = &server_state.get("faktory").unwrap().get("queues").unwrap();
let server_state = client.current_info().await.unwrap();
let queues = &server_state.data.queues;
// our queue are not even mentioned in the server report:
assert!(queues.get(local_1).is_none());
assert!(queues.get(local_2).is_none());
Expand Down Expand Up @@ -418,8 +418,8 @@ async fn queue_control_actions_wildcard() {
assert!(rx.try_recv().is_ok());

// let's inspect the sever state
let server_state = client.info().await.unwrap();
let queues = &server_state.get("faktory").unwrap().get("queues").unwrap();
let server_state = client.current_info().await.unwrap();
let queues = &server_state.data.queues;
assert_eq!(*queues.get(local_1).unwrap(), 1); // 1 job remaining
assert_eq!(*queues.get(local_2).unwrap(), 1); // also 1 job remaining

Expand All @@ -433,9 +433,8 @@ async fn queue_control_actions_wildcard() {
assert!(!rx.try_recv().is_ok());

// let's inspect the sever state again
let server_state = client.info().await.unwrap();
let queues = &server_state.get("faktory").unwrap().get("queues").unwrap();

let server_state = client.current_info().await.unwrap();
let queues = &server_state.data.queues;
// our queue are not even mentioned in the server report:
assert!(queues.get(local_1).is_none());
assert!(queues.get(local_2).is_none());
Expand Down

0 comments on commit d896e64

Please sign in to comment.