stabilize full admin fixture transport and state checks
This commit is contained in:
@@ -43,6 +43,15 @@ function localWallIso(value) {
|
||||
return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(value.getDate())}`
|
||||
+ `T${pad(value.getHours())}:${pad(value.getMinutes())}:${pad(value.getSeconds())}`
|
||||
}
|
||||
function sleep(milliseconds) { return new Promise(resolve => setTimeout(resolve, milliseconds)) }
|
||||
async function manualNodeRequest(context, queryId, body, headers) {
|
||||
for (let attempt = 1; attempt <= 3; attempt += 1) {
|
||||
const response = await context.request('POST', `${BASE}/${queryId}/manual-nodes`, body,
|
||||
context.token, headers)
|
||||
if (response?.http !== 0 || attempt === 3) return response
|
||||
await sleep(600 * attempt)
|
||||
}
|
||||
}
|
||||
|
||||
export function markerOwnedCarrierQuery(context) {
|
||||
const resource = context?.createdResources?.phase3CarrierScheduleQuery
|
||||
@@ -257,8 +266,7 @@ export async function runUntilPickupReady(context) {
|
||||
const body = manualNodePayload({ expectedVersion: version, standardNode,
|
||||
observedAt: localWallIso(new Date()), actualAt, marker: context.marker, index: index + 1 })
|
||||
const key = `${context.marker}-carrier-actual-${String(index + 1).padStart(2, '0')}`.slice(0, 128)
|
||||
const response = await context.request('POST', `${BASE}/${queryId}/manual-nodes`, body,
|
||||
context.token, { 'Idempotency-Key': key })
|
||||
const response = await manualNodeRequest(context, queryId, body, { 'Idempotency-Key': key })
|
||||
const updated = context.apiSuccess(MODULE, `补录实际节点${standardNode}`, response, `queryId=${queryId}`, OPTIONS)
|
||||
assertDetail(context, response, updated, `实际节点${standardNode}响应DTO完整`)
|
||||
const updatedTask = updated?.query?.query
|
||||
|
||||
Reference in New Issue
Block a user