fix(release): AP 部分缺口出表、平台自费计次与工作台预签名 TTL
- AP 抓取缺行不再一律判死,按覆盖率判定;≥95% 出表成功并保留缺口提示 - 无归属代理提取记 0 号平台自费桶,后台可见并推管理员日告警 - 工作台安装包预签名从 180s 提到可配置 3600s,避免慢网上传在途过期
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
||||
package com.nanri.aiimage.modules.appearancepatent.service.support;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class AppearancePatentPartialGapStatusTest {
|
||||
|
||||
private static final String PARTIAL_GAP =
|
||||
"有 3 行抓取失败(未取得商品页数据):B0833QW1CB;B0CZ41T8ZQ;B08R1WH7SS";
|
||||
|
||||
@Test
|
||||
void crawlGapIsPartialNotFatal() {
|
||||
assertTrue(AppearancePatentResultJobSupport.isPartialDataGapError(PARTIAL_GAP));
|
||||
assertTrue(AppearancePatentResultJobSupport.isPartialDataGapError(
|
||||
"有 1 行未完成检测、有 2 行未采集到数据(结果文件中这些行已单独标注)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void assemblyFailureIsStillFatal() {
|
||||
assertFalse(AppearancePatentResultJobSupport.isPartialDataGapError(
|
||||
"已收到 12 个结果分片,但结果文件生成多次失败,任务已自动结束"));
|
||||
assertFalse(AppearancePatentResultJobSupport.isPartialDataGapError(
|
||||
"Generate appearance patent result failed"));
|
||||
assertFalse(AppearancePatentResultJobSupport.isPartialDataGapError(null));
|
||||
assertFalse(AppearancePatentResultJobSupport.isPartialDataGapError(" "));
|
||||
}
|
||||
|
||||
@Test
|
||||
void coverageAtOrAboveFloorSurvivesCrawlGap() {
|
||||
assertFalse(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, PARTIAL_GAP, 1_000, 0.997, 0.95));
|
||||
assertFalse(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, PARTIAL_GAP, 1_000, 0.95, 0.95));
|
||||
}
|
||||
|
||||
@Test
|
||||
void coverageBelowFloorStillFails() {
|
||||
assertTrue(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, PARTIAL_GAP, 1_000, 0.90, 0.95));
|
||||
assertTrue(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, null, 1_000, 0.50, 0.95));
|
||||
}
|
||||
|
||||
@Test
|
||||
void fatalErrorOrTerminalTaskNeverRevives() {
|
||||
assertTrue(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
true, PARTIAL_GAP, 1_000, 1.0, 0.95));
|
||||
assertTrue(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, "结果文件生成多次失败,任务已自动结束", 1_000, 1.0, 0.95));
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyRowAccountKeepsLegacyOutcome() {
|
||||
assertFalse(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, null, 0, 0.0, 0.95));
|
||||
assertTrue(AppearancePatentResultJobSupport.shouldFailAfterAssembly(
|
||||
false, PARTIAL_GAP, 0, 0.0, 0.95));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user