feat: processed-event ledger, idempotent dispatch
This commit is contained in:
@@ -107,3 +107,34 @@ async fn server_publishes_to_the_outbox_even_when_bus_is_nats() {
|
||||
.unwrap();
|
||||
assert_eq!(queued, 1);
|
||||
}
|
||||
|
||||
/// Handler names key the processed-event ledger, so each must be unique. The
|
||||
/// check runs over the real wiring, in both federation builds.
|
||||
#[tokio::test]
|
||||
async fn handler_names_are_unique() {
|
||||
let pool = support::memory_pool().await;
|
||||
let worker = bootstrap::build_worker_on(&support::test_config(), pool)
|
||||
.await
|
||||
.expect("worker builds");
|
||||
|
||||
let names = worker.handler_names();
|
||||
let unique: std::collections::HashSet<_> = names.iter().collect();
|
||||
assert_eq!(
|
||||
unique.len(),
|
||||
names.len(),
|
||||
"duplicate handler name in {names:?}"
|
||||
);
|
||||
for core in [
|
||||
"poster_sync",
|
||||
"image_cleanup",
|
||||
"search_cleanup",
|
||||
"search_reindex",
|
||||
] {
|
||||
assert!(names.contains(&core), "{core} missing from {names:?}");
|
||||
}
|
||||
assert_eq!(
|
||||
names.contains(&"activitypub"),
|
||||
cfg!(feature = "federation"),
|
||||
"{names:?}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user