async fn verify_activity_cancellation(
    worker: &Worker,
    activity_seq: u32,
    cancel_type: ActivityCancellationType,
) {
    poll_and_reply(
        worker,
        NonSticky,
        &[
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::StartWorkflow(_)),
                vec![ScheduleActivity {
                    seq: activity_seq,
                    activity_id: activity_seq.to_string(),
                    cancellation_type: cancel_type as i32,
                    ..Default::default()
                }
                .into()],
            ),
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::SignalWorkflow(_)),
                vec![RequestCancelActivity { seq: activity_seq }.into()],
            ),
            // Activity should be resolved right away
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::ResolveActivity(
                    ResolveActivity {
                        seq: _,
                        result: Some(ActivityResolution {
                            status: Some(activity_resolution::Status::Cancelled(..)),
                        })
                    }
                )),
                vec![CompleteWorkflowExecution { result: None }.into()],
            ),
        ],
    )
    .await;
}
/// Verification for try cancel & abandon histories
Verification for try cancel & abandon histories
Verification for try cancel & abandon histories
async fn verify_activity_cancellation(
    worker: &Worker,
    activity_seq: u32,
    cancel_type: ActivityCancellationType,
) {
    poll_and_reply(
        worker,
        NonSticky,
        &[
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::StartWorkflow(_)),
                vec![ScheduleActivity {
                    seq: activity_seq,
                    activity_id: activity_seq.to_string(),
                    cancellation_type: cancel_type as i32,
                    ..Default::default()
                }
                .into()],
            ),
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::SignalWorkflow(_)),
                vec![RequestCancelActivity { seq: activity_seq }.into()],
            ),
            // Activity should be resolved right away
            gen_assert_and_reply(
                &job_assert!(workflow_activation_job::Variant::ResolveActivity(
                    ResolveActivity {
                        seq: _,
                        result: Some(ActivityResolution {
                            status: Some(activity_resolution::Status::Cancelled(..)),
                        })
                    }
                )),
                vec![CompleteWorkflowExecution { result: None }.into()],
            ),
        ],
    )
    .await;
}
async fn verify_activity_cancellation ( worker : & Worker , activity_seq : u32 , cancel_type : ActivityCancellationType , ) { poll_and_reply ( worker , NonSticky , & [ gen_assert_and_reply ( & job_assert ! ( workflow_activation_job Variant StartWorkflow ( ) ) , vec ! [ ScheduleActivity { seq activity_seq activity_id activity_seq to_string ( ) cancellation_type cancel_type as i32 Default default ( ) } into ( ) ] , ) , gen_assert_and_reply ( & job_assert ! ( workflow_activation_job Variant SignalWorkflow ( ) ) , vec ! [ RequestCancelActivity { seq activity_seq } into ( ) ] , ) , // Activity should be resolved right away gen_assert_and_reply ( & job_assert ! ( workflow_activation_job Variant ResolveActivity ( ResolveActivity { seq result Some ( ActivityResolution { status Some ( activity_resolution Status Cancelled ( ) ) } ) } ) ) , vec ! [ CompleteWorkflowExecution { result None } into ( ) ] , ) , ] , ) . await ; }
Verification for try cancel & abandon histories
Verification for try cancel & abandon histories
worker
&Worker
activity_seq
u32
cancel_type
ActivityCancellationType
worker
&Worker
activity_seq
u32
cancel_type
ActivityCancellationType