Skip to content

Commit

Permalink
test: increate timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
crepererum committed Jan 14, 2022
1 parent 65161d6 commit 48ced12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async fn test_batch_producer() {

let partition_client = Arc::new(client.partition_client(&topic, 0).await.unwrap());
let producer = BatchProducerBuilder::new(partition_client)
.with_linger(Duration::from_secs(2))
.with_linger(Duration::from_secs(5))
.build(RecordAggregator::new(record.approximate_size() * 2 + 1));

let a = producer.produce(record.clone()).fuse();
Expand All @@ -48,15 +48,15 @@ async fn test_batch_producer() {
r = a => r.unwrap(),
r = b => r.unwrap(),
_ = c => panic!("c finished!"),
_ = tokio::time::sleep(Duration::from_millis(1_000)).fuse() => break
_ = tokio::time::sleep(Duration::from_millis(4_000)).fuse() => break
};
}

assert!(a.is_terminated());
assert!(b.is_terminated());

// Third record should eventually be published
tokio::time::timeout(Duration::from_secs(5), c)
tokio::time::timeout(Duration::from_secs(6), c)
.await
.expect("no timeout")
.unwrap();
Expand Down

0 comments on commit 48ced12

Please sign in to comment.