Skip to content

Commit

Permalink
Add e2e test for 'expires_at' ent-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
rustworthy committed Dec 9, 2023
1 parent a80923c commit 87c12e7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/real.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern crate url;

use faktory::*;
use serde_json::Value;
use std::convert::TryInto;
use std::io;
use std::sync;

Expand Down Expand Up @@ -167,18 +168,22 @@ fn queue() {
#[test]
#[cfg(feature = "ent")]
fn expiring_job() {
use std::{thread, time};
use std::{env, thread, time};

let url = env::var_os("FAKTORY_URL").expect(
"Enterprise Faktory should be running for this test, and 'FAKTORY_URL' environment variable should be provided",
);
let url = url.to_str().expect("Is a utf-8 string");

skip_check!();
// prepare a producer ("client" in Faktory terms)
let mut producer = Producer::connect(None).unwrap();
let mut producer = Producer::connect(Some(url)).unwrap();

// prepare a consumer ("worker" in Faktory terms)
let mut consumer = ConsumerBuilder::default();
consumer.register("AnExpiringJob", move |job| -> io::Result<_> {
Ok(eprintln!("{:?}", job))
});
let mut consumer = consumer.connect(None).unwrap();
let mut consumer = consumer.connect(Some(url)).unwrap();

// prepare an expiring job
let job_ttl_secs: u64 = 3;
Expand Down

0 comments on commit 87c12e7

Please sign in to comment.