stabilize full admin fixture transport and state checks

This commit is contained in:
2026-09-23 22:00:00 +08:00
parent 9ad0b9f4c3
commit b1f97bef0f
3 changed files with 26 additions and 6 deletions
@@ -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