Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

764 B
Raw Blame
use super::*;

#[test]
fn lease_loss_is_retryable_and_terminal_completion_is_idempotent() {
    let job_id = Uuid::new_v4();

    assert!(completion_result(job_id, BackfillCompletion::Completed).is_ok());
    assert!(completion_result(job_id, BackfillCompletion::AlreadyTerminal).is_ok());
    assert!(matches!(
        completion_result(job_id, BackfillCompletion::LeaseLost),
        Err(ProcessingError::Retryable(DetailedError {
            reason: FailureReason::EmailBackfillInitBusy,
            ..
        }))
    ));
    assert!(matches!(
        completion_result(job_id, BackfillCompletion::NotFound),
        Err(ProcessingError::NonRetryable(DetailedError {
            reason: FailureReason::BackfillJobNotFound,
            ..
        }))
    ));
}