更新
This commit is contained in:
@@ -45,7 +45,9 @@ foreach ($terminalExpected as $status => [$stage, $phase]) {
|
||||
}
|
||||
}
|
||||
$retry = Progress::task(array_replace($task, ['status' => 'retry_wait', 'next_run_at' => $now + 30, 'error_code' => 'BUDGET_PAUSED']), $now);
|
||||
$expect($retry['wait_remaining_seconds'] === 30 && str_contains($retry['notice'], '额度'), 'retry waiting explains scheduled budget pause');
|
||||
$expect($retry['wait_remaining_seconds'] === 30 && $retry['next_run_at'] === $now + 30
|
||||
&& str_contains($retry['notice'], '额度') && str_contains($retry['notice'], date('Y-m-d H:i:s', $now + 30)),
|
||||
'retry waiting explains the absolute budget eligibility time to both old and new clients');
|
||||
$expect(str_contains($retry['notice'], '上次进度:整理文字资料') && str_contains($retry['notice'], '本次尝试'),
|
||||
'waiting retries retain a trusted stage description and identify attempt timing');
|
||||
$finishedFailure = array_replace($task, ['status' => 'failed', 'finished_at' => $now - 20, 'updated_at' => $now - 1]);
|
||||
@@ -54,8 +56,9 @@ $expect(Progress::task($finishedFailure, $now + 1000)['elapsed_seconds'] === 100
|
||||
$finishedRetry = array_replace($finishedFailure, ['status' => 'retry_wait', 'next_run_at' => $now + 30]);
|
||||
$expect(Progress::task($finishedRetry, $now + 1000)['elapsed_seconds'] === 100,
|
||||
'scheduled retry backoff does not inflate the previous model attempt duration');
|
||||
$expect(Progress::task(array_replace($task, ['status' => 'retry_wait', 'next_run_at' => $now - 30]), $now)['wait_remaining_seconds'] === 0,
|
||||
'elapsed retry deadlines do not become negative');
|
||||
$due = Progress::task(array_replace($task, ['status' => 'retry_wait', 'next_run_at' => $now - 30]), $now);
|
||||
$expect($due['wait_remaining_seconds'] === 0 && $due['next_run_at'] === $now - 30 && str_contains($due['notice'], '等待后台领取'),
|
||||
'elapsed retry deadlines retain the measured eligibility time and wait for a real claim');
|
||||
foreach ([null, '{}', str_repeat('x', 3000), '{invalid', json_encode(['stage' => 'completed', 'phase' => 'completed'])] as $old) {
|
||||
$result = Progress::task(array_replace($task, ['progress_json' => $old]), $now);
|
||||
$expect($result['stage'] === 'unknown' && $result['phase'] === 'running' && $result['stage_elapsed_seconds'] === null,
|
||||
|
||||
Reference in New Issue
Block a user