This commit is contained in:
2026-08-27 15:02:40 +08:00
parent c06b808354
commit 1a0122b648
5 changed files with 20 additions and 11 deletions
+2 -3
View File
@@ -35,13 +35,13 @@ test('completion failure exposes a readable stage and retry entry', () => {
})
})
test('retry reuses the original operation id with the latest server version and command facts', () => {
test('retry reuses the original operation id and request-hashed task version', () => {
const attempt = refreshCompletionAttempt(
{ operationId: 'complete-task-8-v3', expectedTaskVersion: 3, commandId: 'cmd-old' },
{ taskVersion: 7, commandId: 'cmd-latest', commandStatus: 'COMPLETION_FAILED' }
)
assert.equal(attempt.operationId, 'complete-task-8-v3')
assert.equal(attempt.expectedTaskVersion, 7)
assert.equal(attempt.expectedTaskVersion, 3)
assert.equal(attempt.commandId, 'cmd-latest')
assert.throws(() => refreshCompletionAttempt({}, { taskVersion: 7 }), /缺少原完成操作标识/)
assert.throws(() => refreshCompletionAttempt({ operationId: 'stable-id' }), /缺少服务端最新任务版本/)
@@ -59,4 +59,3 @@ test('completed facts win over stale processing facts', () => {
assert.equal(phase, COMPLETION_PHASE.COMPLETED)
assert.equal(completionPresentation(phase).label, '装柜已完成')
})