Validate successful Imagination retries
This commit is contained in:
parent
88778762d6
commit
5b922a049f
6 changed files with 63 additions and 6 deletions
|
|
@ -3162,6 +3162,20 @@ pub(crate) mod tests {
|
|||
Some(failed.result_id.as_str())
|
||||
);
|
||||
assert_eq!(attempts[1].job_id, retry_job_id);
|
||||
assert_eq!(
|
||||
attempts[1].binding_record_id,
|
||||
format!(
|
||||
"repo-frontier-planning-launch-{}-attempt-1",
|
||||
planning.request_id
|
||||
)
|
||||
);
|
||||
let retry_result =
|
||||
frontier_planning_result(&planning, retry_job_id, "2026-07-15T09:00:07Z")?;
|
||||
put_runtime_role_worker_result(&store, &retry_result)?;
|
||||
assert_eq!(
|
||||
crate::runtime_repo_frontier_planning_lifecycle(&store)?.stage,
|
||||
crate::RepoFrontierPlanningLifecycleStage::ImaginationResultReady
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2028,10 +2028,17 @@ pub fn put_runtime_role_worker_result(
|
|||
"{:x}",
|
||||
Sha256::digest(&worker_launch.launch_document_msgpack)
|
||||
);
|
||||
let expected_binding_record_id = if binding.attempt_ordinal == 0 {
|
||||
format!("repo-frontier-planning-launch-{}", request.request_id)
|
||||
} else {
|
||||
format!(
|
||||
"repo-frontier-planning-launch-{}-attempt-{}",
|
||||
request.request_id, binding.attempt_ordinal
|
||||
)
|
||||
};
|
||||
if binding.schema_version != REPO_FRONTIER_PLANNING_LAUNCH_BINDING_SCHEMA_VERSION
|
||||
|| binding.contract != REPO_FRONTIER_PLANNING_LAUNCH_BINDING_CONTRACT
|
||||
|| binding.binding_record_id
|
||||
!= format!("repo-frontier-planning-launch-{}", request.request_id)
|
||||
|| binding.binding_record_id != expected_binding_record_id
|
||||
|| binding.job_id != result.job_id
|
||||
|| binding.binding_id != EPIPHANY_IMAGINATION_ROLE_BINDING_ID
|
||||
|| binding.runtime_id != request.runtime_id
|
||||
|
|
|
|||
Reference in a new issue