fix(前端测试): 修复 npm test 卡死——定时器泄漏 + 去套娃 + 强制退出/超时
- 根因:polling-backoff-recovery 测试断言失败后跳过 loop.dispose(),残留自续期定时器导致 node --test 子进程永不退出 - dead-code-cleanup:移除套娃用例 test_full_vitest_green(再跑一遍全量套件,放大问题),execSync 加 300s 超时;其余静态断言保留 - package.json:node --test --test-force-exit --test-timeout=180000 - CI workflow 前端测试步骤改为 npm test(与 package.json 单一来源) - 修正 3 处过时期望值(轮询退避/品牌 files+taskType/巡店 delete_conditions) - 验证:本地 666 用例全过,19-24s,无残留进程
This commit is contained in:
@@ -186,7 +186,7 @@ test('test_patrol_delete_create_submit', async (t) => {
|
||||
await createPatrolDeleteTask([item])
|
||||
assert.equal(calls[0].url, '/newApi/api/patrol-delete/tasks')
|
||||
assert.equal(calls[0].method, 'POST')
|
||||
assert.deepEqual(calls[0].data, { user_id: 42, items: [item] })
|
||||
assert.deepEqual(calls[0].data, { user_id: 42, items: [item], delete_conditions: [] })
|
||||
const payload = { shops: [{ shopName: '店铺A', countrySections: item.countrySections, cartRatios: item.cartRatios, shopDone: true, chunkIndex: 0, chunkTotal: 1 }] }
|
||||
await submitPatrolDeleteTaskResult(7, payload)
|
||||
assert.equal(calls[1].url, '/newApi/api/patrol-delete/tasks/7/result')
|
||||
|
||||
Reference in New Issue
Block a user