test(phase-3): 首迁前把 shopmatch/pricetrack 的回传段落库钉成 golden

蓝图 §5 Phase 0 收口那句「submitResult 出结果段本轮未打快照,Phase 3 要动那一段须先补再动」
是这一笔的全部理由:首迁要替换的正是这一段(取锁→准入→按店名建索引→逐行合并→changed 闸门
→重算状态换成 AbstractShopPayloadTaskPipeline 的模板),没有迁移前的流水,「对外行为未变」就只能嘴上说。

快照渲染的是**调用顺序流水**而不是分组清单——回传段的风险恰恰在副作用先后:先标失败还是先挂文件、
mergedRemove 在不在 enqueue 之后、changed=false 时任务表一次都不许写、taskId 非法时锁一次都不该被碰。
结果行是一份内存表(重读看得见前一次写入),店铺合并载荷是一份 HashMap 接住 get/save/remove,
于是分片回传的合并语义是真的,不是把合并跳过。时钟、雪花 id、OSS 直链一律不进快照。

两支各自 15 例,差异逐条钉住(这些正是迁移时最容易被「顺手统一」掉的):ShopMatch 闸门是
「行数>0 且有 done」,所以 :689 那句「未收到可用于组装的结果数据」在 submitResult 路径上不可达
(只有 tryFinalizeTask 的判序到得了);PriceTrack 闸门只看 success==TRUE,那条可达,
且它多一段排队前的服务端改价次数(基线读不到一律从 0 起算)、终态多一件循环轮次同步、
错误分隔符是半角 "; " 而 ShopMatch 是全角「;」。

golden 生成器用 @EnabledIfEnvironmentVariable 而非 -D:pom 的 <argLine> 是显式配置,
命令行 -DargLine 覆盖不动它,系统属性传不进 forked JVM——第一次跑就是这么发现「写了却没落盘」的。
This commit is contained in:
2026-10-18 19:09:48 +08:00
parent e90e5e7f64
commit 121ae9b064
4 changed files with 1220 additions and 0 deletions
@@ -0,0 +1,101 @@
== case=happyShop
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=改价成功 modifyCount=- rows=1
payloadSave: taskId=1001 moduleType=PRICE_TRACK scopeKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=改价成功 modifyCount=1 rows=1
result.update: id=2001 success=1 error=- filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=PRICE_TRACK resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=6 heartbeatTouches=1 lockCloses=1
== case=unknownShopWritesNothing
events=0 heartbeatTouches=1 lockCloses=1
== case=successFalseWithRowsProducesPartial
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=false countries=1
row: country=UK asin=B001 price=19.90 changeStatus=- modifyCount=- rows=1
result.update: id=2001 success=0 error=shop processing failed filename=- urlPresent=false size=0 contentType=- rowCount=0
payloadSave: taskId=1001 moduleType=PRICE_TRACK scopeKey=店铺A shopName=店铺A error=- success=false countries=1
row: country=UK asin=B001 price=19.90 changeStatus=- modifyCount=0 rows=1
result.update: id=2001 success=0 error=shop processing failed filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=PRICE_TRACK resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=7 heartbeatTouches=1 lockCloses=1
== case=errorWithRows
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=店铺登录失败 success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=- modifyCount=- rows=1
result.update: id=2001 success=0 error=店铺登录失败 filename=- urlPresent=false size=0 contentType=- rowCount=0
payloadSave: taskId=1001 moduleType=PRICE_TRACK scopeKey=店铺A shopName=店铺A error=店铺登录失败 success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=- modifyCount=0 rows=1
result.update: id=2001 success=0 error=店铺登录失败 filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=PRICE_TRACK resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=7 heartbeatTouches=1 lockCloses=1
== case=errorWithoutRows
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=店铺登录失败 success=true countries=0 rows=0
result.update: id=2001 success=0 error=店铺登录失败 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=1 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=4 heartbeatTouches=1 lockCloses=1
== case=completedWithoutUsableRows
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=DE asin=- price=1.00 changeStatus=- modifyCount=- rows=1
result.update: id=2001 success=0 error=未收到有效跟价数据,未生成结果文件 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=1 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=4 heartbeatTouches=1 lockCloses=1
== case=blankErrorFallsBackToNoUsableRowsMessage
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=DE asin=- price=1.00 changeStatus=- modifyCount=- rows=1
result.update: id=2001 success=0 error=未收到有效跟价数据,未生成结果文件 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=1 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=4 heartbeatTouches=1 lockCloses=1
== case=chunkWithoutSuccessWaits
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=- countries=1
row: country=UK asin=B001 price=19.90 changeStatus=- modifyCount=- rows=1
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=2 heartbeatTouches=1 lockCloses=1
== case=chunkedMergeAcrossTwoSubmissions
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=UPDATED modifyCount=- rows=1
payloadSave: taskId=1001 moduleType=PRICE_TRACK scopeKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B001 price=19.90 changeStatus=UPDATED modifyCount=1 rows=1
result.update: id=2001 success=1 error=- filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=PRICE_TRACK resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=6 heartbeatTouches=2 lockCloses=2
== case=skipAsinDeleteSignalChangesNothing
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B002 price=8.00 changeStatus=- modifyCount=- rows=1
payloadSave: taskId=1001 moduleType=PRICE_TRACK scopeKey=店铺A shopName=店铺A error=- success=true countries=1
row: country=UK asin=B002 price=8.00 changeStatus=- modifyCount=0 rows=1
result.update: id=2001 success=1 error=- filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=PRICE_TRACK resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=2 error=- resultJsonItems=2 finishedPresent=false
events=6 heartbeatTouches=1 lockCloses=1
== case=allShopsFailedFinalizesTask
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- success=false countries=0 rows=0
result.update: id=2001 success=0 error=shop processing failed filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
mergedSave: taskId=1001 shopKey=店铺B shopName=店铺B error=- success=false countries=0 rows=0
result.update: id=2002 success=0 error=shop processing failed filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺B
task.update: id=1001 status=FAILED ok=0 fail=2 sourceFileCount=2 error=店铺A: shop processing failed; 店铺B: shop processing failed resultJsonItems=2 finishedPresent=true
taskCacheDelete: taskId=1001
loopRunSync: taskId=1001
events=9 heartbeatTouches=1 lockCloses=1
== case=terminalTaskRejectedWith40901
thrown: BusinessException code=40901 message=任务已结束,拒绝重复提交
== case=wrongModuleTaskNotFound
thrown: BusinessException code=- message=任务不存在
== case=invalidTaskIdRejectedBeforeLock
thrown: BusinessException code=- message=taskId 不合法
events=0 heartbeatTouches=0 lockCloses=0
== case=emptyShops
thrown: BusinessException code=- message=shops 不能为空
== case=nullRequest
thrown: BusinessException code=- message=shops 不能为空
@@ -0,0 +1,76 @@
== case=happyTwoShops
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
payloadSave: taskId=1001 moduleType=SHOP_MATCH scopeKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
result.update: id=2001 success=1 error=- filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=SHOP_MATCH resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
mergedSave: taskId=1001 shopKey=店铺B shopName=店铺B error=- countries=1 rows=1 skipDetailCountries=0
payloadSave: taskId=1001 moduleType=SHOP_MATCH scopeKey=店铺B shopName=店铺B error=- countries=1 rows=1 skipDetailCountries=0
result.update: id=2002 success=1 error=- filename=店铺B.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=SHOP_MATCH resultId=2002 scopeKey=店铺B
mergedRemove: taskId=1001 shopKey=店铺B
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=12 heartbeatTouches=1 lockCloses=1
== case=unknownShopWritesNothing
events=0 heartbeatTouches=1 lockCloses=1
== case=nullAndBlankShopSkipped
events=0 heartbeatTouches=1 lockCloses=1
== case=failedShopWithPartialRows
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=会话掉线 countries=1 rows=1 skipDetailCountries=0
result.update: id=2001 success=0 error=会话掉线 filename=- urlPresent=false size=0 contentType=- rowCount=0
payloadSave: taskId=1001 moduleType=SHOP_MATCH scopeKey=店铺A shopName=店铺A error=会话掉线 countries=1 rows=1 skipDetailCountries=0
result.update: id=2001 success=0 error=会话掉线 filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=SHOP_MATCH resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=8 heartbeatTouches=1 lockCloses=1
== case=failedShopWithoutRows
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=店铺打不开 countries=0 rows=0 skipDetailCountries=0
result.update: id=2001 success=0 error=店铺打不开 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=1 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=5 heartbeatTouches=1 lockCloses=1
== case=allShopsFailedFinalizesTask
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=店铺打不开 countries=0 rows=0 skipDetailCountries=0
result.update: id=2001 success=0 error=店铺打不开 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺A
mergedSave: taskId=1001 shopKey=店铺B shopName=店铺B error=国家页超时 countries=0 rows=0 skipDetailCountries=0
result.update: id=2002 success=0 error=国家页超时 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=店铺B
task.update: id=1001 status=FAILED ok=0 fail=2 sourceFileCount=null error=店铺A: 店铺打不开;店铺B: 国家页超时 resultJsonItems=2 finishedPresent=true
taskCacheSave: id=1001
taskCacheDelete: taskId=1001
events=9 heartbeatTouches=1 lockCloses=1
== case=blankAsinWithDoneFlagStillWaits
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=3 heartbeatTouches=1 lockCloses=1
== case=partialChunkWaitsForMore
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=3 heartbeatTouches=1 lockCloses=1
== case=chunkedMergeAcrossTwoSubmissions
mergedSave: taskId=1001 shopKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
payloadSave: taskId=1001 moduleType=SHOP_MATCH scopeKey=店铺A shopName=店铺A error=- countries=1 rows=1 skipDetailCountries=0
result.update: id=2001 success=1 error=- filename=店铺A.xlsx urlPresent=false size=0 contentType=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet rowCount=1
enqueue: taskId=1001 moduleType=SHOP_MATCH resultId=2001 scopeKey=店铺A
mergedRemove: taskId=1001 shopKey=店铺A
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=2 finishedPresent=false
taskCacheSave: id=1001
events=7 heartbeatTouches=2 lockCloses=2
== case=terminalTaskRejectedWith40901
thrown: BusinessException code=40901 message=任务已结束,拒绝重复提交
== case=wrongModuleTaskNotFound
thrown: BusinessException code=- message=任务不存在
== case=invalidTaskIdRejectedBeforeLock
thrown: BusinessException code=- message=taskId 不合法
events=0 heartbeatTouches=0 lockCloses=0
== case=emptyShops
thrown: BusinessException code=- message=shops 不能为空
== case=nullRequest
thrown: BusinessException code=- message=shops 不能为空