🐛 fix: 限制文件完成阶段的连续失败重试
* 保留处理中轮询,避免处理中响应重置失败计数导致无限重试 * 验证交替处理中及存储错误在四次失败后结束,保留手动重试能力
This commit is contained in:
1 parent
f7bae99fe4
commit
d03c4e1315
2 files changed
+13
-1
No files matched your search
@@ -19,3 +19,16 @@ test('transient network failure during verification retries the same completion
|
||||
calls++;if(calls===1)return {code:202};if(calls===2)throw new Error('offline');return {code:200,detail:{code:'SAMECODE'}}
|
||||
});assert.equal(calls,3);assert.equal(result.detail.code,'SAMECODE')
|
||||
})
|
||||
|
||||
|
||||
test('pending replies between failed completion tasks do not reset the retry limit',async t=>{
|
||||
t.mock.timers.enable({apis:['setTimeout']})
|
||||
let calls=0
|
||||
const pending=waitForUploadCompletion(async()=>{
|
||||
calls++;if(calls%2===1)return {code:202}
|
||||
throw Object.assign(new Error('storage unavailable'),{response:{status:503}})
|
||||
})
|
||||
const rejected=assert.rejects(pending,/storage unavailable/)
|
||||
for(let i=0;i<8;i++){await new Promise(r=>setImmediate(r));t.mock.timers.tick(3000)}
|
||||
await rejected;assert.equal(calls,8);t.mock.timers.reset()
|
||||
})
|
||||
Reference in new issue
Block a user