test(phase-3): 3B 迁移前把 shopdatacrawl 的建单与回传两段钉成 golden

蓝图 §4 Phase 3 首迁实录写的开工前置第①条——「那五支的 submitResult 同样没有 golden,
各自补完才能动」。本笔只补件、不动生产码一支。

回传段 20 例、建单段 14 例,渲染的是副作用**先后**流水而不是分组清单,三格专门钉住
Phase 2/3 已登记的「不许顺手统一」:
- ownershipCheckedBeforeTerminal:本支先查归属再判终态(底座 admitSubmission 默认序相反),
  套错就 40903 → 「任务已结束」;
- terminalTaskRejectedWithoutCode:终态重复提交本支不带 40901,线协议与孪生两支不同;
- completedRowFlushesWorkbookColumns:收尾刷结果列走 LambdaUpdateWrapper 批量条件更新
  (只刷 success=1 的行、不写 success/errorMessage、objectKey 传 null),publishResultFile 不适用。

建单段另钉一格快照本来看不见的性质:建单时刻一枚复用给头行与每一行结果行,故只断
createdAtEqualsTaskCreatedAt=true 而不打印时钟——底座五参 newTaskHeader 是「逐行各取一次」那一派,
照搬就把这格改成 false。
This commit is contained in:
2026-10-19 02:31:42 +08:00
parent 278eaaec2c
commit b11bc599cd
4 changed files with 1496 additions and 0 deletions
@@ -0,0 +1,63 @@
== case=happySingleShopTwoCountries
vo: taskId=1001 items=1
item: resultId=2001 taskId=1001 shopName=Demo Shop shopId=shop-Demo Shop platform=Amazon companyName=公司-Demo Shop matched=true matchStatus=MATCHED taskStatus=RUNNING success=- error=- countryCodes=[UK, DE] countryResults=0 downloadUrl=-
events=7 taskInserts=1 resultInserts=1 heartbeatTouches=1
evt: task.insert: id=1001 taskNoPrefix=SHOP_DATA_CRAWL moduleType=SHOP_DATA_CRAWL taskMode=PYTHON_QUEUE status=RUNNING sourceFileCount=1 ok=0 fail=0 userId=7 createdBy=user:7 deviceId=dev-1 ownerInstanceId=- requestJsonPresent=false resultJsonPresent=false
evt: taskCacheSave: id=1001
evt: result.insert: id=2001 taskId=1001 moduleType=SHOP_DATA_CRAWL sourceFilename=Demo Shop sourceFileUrl=shop-Demo Shop userId=7 success=-1 rowCount=- createdAtEqualsTaskCreatedAt=true
evt: snapshotTable.replace: taskId=1001 items=1
evt: progressSave: taskId=1001 status=RUNNING total=1 ok=0 fail=0
evt: task.update: id=1001 status=RUNNING ok=0 fail=0 requestJsonHasOwner=true requestJsonItems=1 resultJsonItems=1 createdAtEqualsUpdatedAt=true
evt: taskCacheSave: id=1001
== case=requestFieldsOverwrittenByMatch
vo: taskId=1001 items=1
item: resultId=2001 taskId=1001 shopName=Demo Shop shopId=shop-Demo Shop platform=Amazon companyName=公司-Demo Shop matched=true matchStatus=MATCHED taskStatus=RUNNING success=- error=- countryCodes=[UK] countryResults=0 downloadUrl=-
events=7 taskInserts=1 resultInserts=1 heartbeatTouches=1
evt: task.insert: id=1001 taskNoPrefix=SHOP_DATA_CRAWL moduleType=SHOP_DATA_CRAWL taskMode=PYTHON_QUEUE status=RUNNING sourceFileCount=1 ok=0 fail=0 userId=7 createdBy=user:7 deviceId=dev-1 ownerInstanceId=- requestJsonPresent=false resultJsonPresent=false
evt: taskCacheSave: id=1001
evt: result.insert: id=2001 taskId=1001 moduleType=SHOP_DATA_CRAWL sourceFilename=Demo Shop sourceFileUrl=shop-Demo Shop userId=7 success=-1 rowCount=- createdAtEqualsTaskCreatedAt=true
evt: snapshotTable.replace: taskId=1001 items=1
evt: progressSave: taskId=1001 status=RUNNING total=1 ok=0 fail=0
evt: task.update: id=1001 status=RUNNING ok=0 fail=0 requestJsonHasOwner=true requestJsonItems=1 resultJsonItems=1 createdAtEqualsUpdatedAt=true
evt: taskCacheSave: id=1001
== case=twoItemsRejected
thrown: BusinessException code=- message=items 必须且只能包含一个店铺
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=emptyItemsRejected
thrown: BusinessException code=- message=items 必须且只能包含一个店铺
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=nullItemsRejected
thrown: BusinessException code=- message=items 必须且只能包含一个店铺
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=rawTwoItemsSameShopRejectedFirstGate
thrown: BusinessException code=- message=items 必须且只能包含一个店铺
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=blankShopNameDropped
thrown: BusinessException code=- message=items 必须且只能包含一个有效店铺
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=reNormalizedToBlankRejects
thrown: BusinessException code=- message=任务数据已失效,请刷新后重试
events=2 taskInserts=1 resultInserts=0 heartbeatTouches=1
evt: task.insert: id=1001 taskNoPrefix=SHOP_DATA_CRAWL moduleType=SHOP_DATA_CRAWL taskMode=PYTHON_QUEUE status=RUNNING sourceFileCount=1 ok=0 fail=0 userId=7 createdBy=user:7 deviceId=dev-1 ownerInstanceId=- requestJsonPresent=false resultJsonPresent=false
evt: taskCacheSave: id=1001
== case=unmatchedShopRejected
thrown: BusinessException code=- message=店铺未匹配
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=usIsNotSupportedCountry
thrown: BusinessException code=- message=非法国家代码: US
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=duplicateCountryCodeRejected
thrown: BusinessException code=- message=country_codes 存在重复: UK
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=emptyCountryCodesRejected
thrown: BusinessException code=- message=country_codes 至少选择 1 个国家
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=blankCountryCodeRejected
thrown: BusinessException code=- message=country_codes 含空项
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=nullUserIdRejected
thrown: BusinessException code=- message=user_id 不合法
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
== case=zeroUserIdRejected
thrown: BusinessException code=- message=user_id 不合法
events=0 taskInserts=0 resultInserts=0 heartbeatTouches=0
@@ -0,0 +1,138 @@
== case=happyLegacyDone
taskCacheSave: id=1001
mergedSave: taskId=1001 shopKey=Demo Shop shopName=Demo Shop error=- countries=1 rows=1 done=true chunk=null/null
result.update: id=2001 success=1 error=- filename=- urlPresent=false size=null contentType=- rowCount=null
mergedRemove: taskId=1001 shopKey=Demo Shop
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=RUNNING total=1 ok=1 fail=0
task.update: id=1001 status=RUNNING ok=null fail=null sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
result.batchUpdate: columns=resultFilename,resultFileUrl,resultFileSize,resultContentType,rowCount where=(id IN (#{ew.paramNameValuePairs.MPGENVAL6}) AND success = #{ew.paramNameValuePairs.MPGENVAL7}) params=MPGENVAL1="店铺数据抓取-Demo Shop-1001.xlsx",MPGENVAL2=null,MPGENVAL3=0,MPGENVAL4="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",MPGENVAL5=1
enqueue: taskId=1001 resultId=2001 scopeKey=task:1001:owner:instance-a
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=SUCCESS total=1 ok=1 fail=0
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
taskCacheDelete: taskId=1001
events=16 heartbeatTouches=1 lockCloses=2 chunks=0 scopes=0 rustfs=0
== case=failedShopFinalizesTaskFailed
taskCacheSave: id=1001
result.update: id=2001 success=0 error=店铺打不开 filename=- urlPresent=false size=0 contentType=- rowCount=0
mergedRemove: taskId=1001 shopKey=Demo Shop
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=RUNNING total=1 ok=0 fail=1
task.update: id=1001 status=RUNNING ok=null fail=null sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=false finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=FAILED total=1 ok=0 fail=1
task.update: id=1001 status=FAILED ok=0 fail=1 sourceFileCount=null error=Demo Shop: 店铺打不开 resultJsonItems=1 resultJsonHasRows=false finishedPresent=true
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=FAILED total=1 ok=0 fail=1
task.update: id=1001 status=FAILED ok=0 fail=1 sourceFileCount=null error=Demo Shop: 店铺打不开 resultJsonItems=1 resultJsonHasRows=false finishedPresent=true
taskCacheDelete: taskId=1001
events=15 heartbeatTouches=1 lockCloses=2 chunks=0 scopes=0 rustfs=0
== case=legacyWithoutDoneWaits
taskCacheSave: id=1001
mergedSave: taskId=1001 shopKey=Demo Shop shopName=Demo Shop error=- countries=1 rows=1 done=null chunk=null/null
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=RUNNING total=1 ok=0 fail=0
task.update: id=1001 status=RUNNING ok=null fail=null sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=false
taskCacheSave: id=1001
events=9 heartbeatTouches=1 lockCloses=2 chunks=0 scopes=0 rustfs=0
== case=shopNameMismatchRejected
thrown: BusinessException code=- message=回传店铺与任务不匹配
== case=twoShopsRejectedBeforeLock
thrown: BusinessException code=- message=shops 必须且只能包含一个店铺结果
== case=nullRequestRejectedBeforeLock
thrown: BusinessException code=- message=shops 必须且只能包含一个店铺结果
== case=nullShopInListRejected
thrown: BusinessException code=- message=shops 包含空结果
== case=invalidTaskIdRejectedBeforeLock
thrown: BusinessException code=- message=taskId 不合法
events=0 heartbeatTouches=0 lockCloses=0 chunks=0 scopes=0 rustfs=0
== case=terminalTaskRejectedWithoutCode
thrown: BusinessException code=- message=任务已结束,拒绝重复提交
== case=wrongModuleTaskNotFound
thrown: BusinessException code=- message=任务不存在
== case=ownershipCheckedBeforeTerminal
thrown: TaskOwnerMismatchException code=40903 message=该任务已绑定到另一台服务实例处理,请通过原实例继续处理
== case=twoResultRowsRejected
thrown: BusinessException code=- message=任务店铺数据异常
== case=partialChunkStored
taskCacheSave: id=1001
payloadStore: pointer=rustfs:payload-1
chunkInsert: idx=1/2 hash=eafc7b7e1451 scopeKey=result-chunks:Demo Shop
scopeInsert: received=1 total=2 completed=0 scopeKey=result-chunks:Demo Shop
task.update: id=1001 status=RUNNING ok=null fail=null sourceFileCount=null error=- resultJsonItems=0 resultJsonHasRows=false finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=0 resultJsonHasRows=false finishedPresent=false
taskCacheSave: id=1001
events=9 heartbeatTouches=1 lockCloses=2 chunks=1 scopes=1 rustfs=1
== case=secondChunkArrivesFirst
taskCacheSave: id=1001
payloadStore: pointer=rustfs:payload-2
chunkInsert: idx=1/2 hash=eafc7b7e1451 scopeKey=result-chunks:Demo Shop
scopeUpdate: received=2 total=2 completed=1 scopeKey=result-chunks:Demo Shop
payloadResolve: pointer=rustfs:payload-2
payloadResolve: pointer=rustfs:payload-1
result.update: id=2001 success=1 error=- filename=- urlPresent=false size=null contentType=- rowCount=null
mergedRemove: taskId=1001 shopKey=Demo Shop
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=RUNNING total=1 ok=1 fail=0
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
result.batchUpdate: columns=resultFilename,resultFileUrl,resultFileSize,resultContentType,rowCount where=(id IN (#{ew.paramNameValuePairs.MPGENVAL6}) AND success = #{ew.paramNameValuePairs.MPGENVAL7}) params=MPGENVAL1="店铺数据抓取-Demo Shop-1001.xlsx",MPGENVAL2=null,MPGENVAL3=0,MPGENVAL4="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",MPGENVAL5=1
enqueue: taskId=1001 resultId=2001 scopeKey=task:1001:owner:instance-a
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=SUCCESS total=1 ok=1 fail=0
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
taskCacheDelete: taskId=1001
events=20 heartbeatTouches=2 lockCloses=4 chunks=2 scopes=1 rustfs=2
== case=identicalChunkRetryAbsorbed
taskCacheSave: id=1001
payloadStore: pointer=rustfs:payload-2
payloadDelete: pointer=rustfs:payload-2
scopeUpdate: received=1 total=2 completed=0 scopeKey=result-chunks:Demo Shop
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=0 resultJsonHasRows=false finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=RUNNING ok=0 fail=0 sourceFileCount=null error=- resultJsonItems=0 resultJsonHasRows=false finishedPresent=false
taskCacheSave: id=1001
events=9 heartbeatTouches=2 lockCloses=4 chunks=1 scopes=1 rustfs=1
== case=chunkRetryWithDifferentContentRejected
thrown: BusinessException code=- message=同一 chunk_index 已回传不同内容,拒绝覆盖
== case=chunkIndexWithoutTotalRejected
thrown: BusinessException code=- message=chunk_index 与 chunk_total 必须同时传入
== case=chunkTotalChangeRejected
thrown: BusinessException code=- message=同一店铺的 chunk_total 必须保持一致
== case=chunkRejectedWhenRustfsDisabled
thrown: BusinessException code=- message=RustFS 未配置,店铺数据抓取结果分片暂不可接收
== case=completedRowFlushesWorkbookColumns
taskCacheSave: id=1001
payloadStore: pointer=rustfs:payload-1
chunkInsert: idx=1/1 hash=b6c082cd9d58 scopeKey=result-chunks:Demo Shop
scopeInsert: received=1 total=1 completed=1 scopeKey=result-chunks:Demo Shop
payloadResolve: pointer=rustfs:payload-1
result.update: id=2001 success=1 error=- filename=- urlPresent=false size=null contentType=- rowCount=null
mergedRemove: taskId=1001 shopKey=Demo Shop
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=RUNNING total=1 ok=1 fail=0
task.update: id=1001 status=RUNNING ok=null fail=null sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=false
taskCacheSave: id=1001
taskCacheSave: id=1001
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
result.batchUpdate: columns=resultFilename,resultFileUrl,resultFileSize,resultContentType,rowCount where=(id IN (#{ew.paramNameValuePairs.MPGENVAL6}) AND success = #{ew.paramNameValuePairs.MPGENVAL7}) params=MPGENVAL1="店铺数据抓取-Demo Shop-1001.xlsx",MPGENVAL2=null,MPGENVAL3=0,MPGENVAL4="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",MPGENVAL5=1
enqueue: taskId=1001 resultId=2001 scopeKey=task:1001:owner:instance-a
snapshotTable.replace: taskId=1001 items=1
progressSave: taskId=1001 status=SUCCESS total=1 ok=1 fail=0
task.update: id=1001 status=SUCCESS ok=1 fail=0 sourceFileCount=null error=- resultJsonItems=1 resultJsonHasRows=true finishedPresent=true
taskCacheDelete: taskId=1001
events=19 heartbeatTouches=1 lockCloses=2 chunks=1 scopes=1 rustfs=1