test: 放宽异步投递用例的等待窗口避免抖动
This commit is contained in:
+3
-2
@@ -145,7 +145,7 @@ class AiTaskIntegrationTest {
|
|||||||
}
|
}
|
||||||
Thread.sleep(50);
|
Thread.sleep(50);
|
||||||
}
|
}
|
||||||
fail("任务在 5 秒内未进入终态,最后状态: " + (response == null ? "null" : response.getStatus()));
|
fail("任务在 15 秒内未进入终态,最后状态: " + (response == null ? "null" : response.getStatus()));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +264,8 @@ class AiTaskIntegrationTest {
|
|||||||
AiTaskResponse submitted = aiTaskService.submit(request("MIND_MAP", taskNum, Map.of("mode", "full")));
|
AiTaskResponse submitted = aiTaskService.submit(request("MIND_MAP", taskNum, Map.of("mode", "full")));
|
||||||
|
|
||||||
AiTaskResponse finalState = null;
|
AiTaskResponse finalState = null;
|
||||||
for (int i = 0; i < 50; i++) {
|
// 全量测试时 JVM 负载高,异步投递可能被推迟,因此给足等待窗口(断言本身不放宽)
|
||||||
|
for (int i = 0; i < 150; i++) {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
finalState = aiTaskService.getByTaskNum(submitted.getTaskNum());
|
finalState = aiTaskService.getByTaskNum(submitted.getTaskNum());
|
||||||
if (finalState.getStatus().equals(AiTaskStatusEnum.SUCCEEDED.name())
|
if (finalState.getStatus().equals(AiTaskStatusEnum.SUCCEEDED.name())
|
||||||
|
|||||||
Reference in New Issue
Block a user