strip session-added comments
This commit is contained in:
@@ -377,7 +377,6 @@ impl EventHandler for CountingHandler {
|
||||
}
|
||||
}
|
||||
|
||||
/// Delivers the same event (same id) `times` times, recording ack/nack per delivery.
|
||||
struct RedeliveringConsumer {
|
||||
id: Option<domain::events::EventId>,
|
||||
event: DomainEvent,
|
||||
@@ -416,8 +415,6 @@ impl EventConsumer for RedeliveringConsumer {
|
||||
Box::new(CountNack(Arc::clone(&nacks), Arc::clone(&defers))),
|
||||
);
|
||||
async move {
|
||||
// Let the previous delivery's handlers finish first: a real
|
||||
// broker redelivers only after the nack.
|
||||
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
|
||||
Ok(envelope)
|
||||
}
|
||||
@@ -498,7 +495,6 @@ async fn a_handler_already_running_elsewhere_is_not_run_concurrently() {
|
||||
let (handler, calls) = CountingHandler::new("slow", 0);
|
||||
let store = InMemoryStore::new();
|
||||
let id = domain::events::EventId::new();
|
||||
// Another delivery holds a live claim on this (event, handler).
|
||||
assert!(matches!(
|
||||
store.begin(&id, "slow").await.unwrap(),
|
||||
Begin::Run(_)
|
||||
@@ -560,7 +556,6 @@ async fn a_delivery_blocked_by_a_live_claim_is_deferred_without_consuming_an_att
|
||||
assert_eq!(*nacks.lock().unwrap(), 0, "a nack would consume an attempt");
|
||||
let defers = defers.lock().unwrap();
|
||||
assert_eq!(defers.len(), 1);
|
||||
// Retried only once the claim's lease has run out (plus a margin).
|
||||
let lease = std::time::Duration::from_secs(HANDLER_LEASE_SECONDS as u64);
|
||||
assert!(
|
||||
defers[0] > lease - std::time::Duration::from_secs(5),
|
||||
@@ -588,7 +583,6 @@ async fn a_lapsed_owner_cannot_release_a_claim_taken_over_by_another() {
|
||||
let Begin::Run(lapsed) = store.begin(&id, "h").await.unwrap() else {
|
||||
panic!("stale claim should be taken over");
|
||||
};
|
||||
// Simulate: the original owner's token is from before the takeover.
|
||||
let original = domain::ports::ClaimToken::new("2020-01-01T00:00:00.000Z".into());
|
||||
assert_ne!(original, lapsed);
|
||||
|
||||
@@ -652,7 +646,6 @@ async fn a_failed_handler_releases_its_claim_so_redelivery_retries() {
|
||||
.run(tokio::sync::watch::channel(false).1)
|
||||
.await;
|
||||
|
||||
// Delivery 1 fails and releases; 2 succeeds; 3 is skipped as done.
|
||||
assert_eq!(*calls.lock().unwrap(), 2);
|
||||
assert_eq!(*nacks.lock().unwrap(), 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user