修复后台轮询干扰会话隔离测试
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m23s
Project CI / AI game creator shell Rust shard 4/4 (push) Failing after 5m19s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m52s
Project CI / AI game creator shell Rust shard 3/4 (push) Failing after 5m43s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m40s
Project CI / AI game creator shell Rust crates (push) Successful in 1m38s
Project CI / Frontend tests (push) Failing after 3m22s
Project CI / Repository checks (push) Successful in 5m1s
Project CI / Native shell tests (push) Successful in 6m34s
Project CI / Backend tests (push) Successful in 7m23s
Project CI / AI game creator shell web tests (push) Successful in 3m2s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m23s
Project CI / AI game creator shell Rust shard 4/4 (push) Failing after 5m19s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m52s
Project CI / AI game creator shell Rust shard 3/4 (push) Failing after 5m43s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m40s
Project CI / AI game creator shell Rust crates (push) Successful in 1m38s
Project CI / Frontend tests (push) Failing after 3m22s
Project CI / Repository checks (push) Successful in 5m1s
Project CI / Native shell tests (push) Successful in 6m34s
Project CI / Backend tests (push) Successful in 7m23s
Project CI / AI game creator shell web tests (push) Successful in 3m2s
只核对刷新之后最后一次目标会话读取的完整参数 避免无关活动回合轮询改变全局最后调用而造成偶发失败 补充 IPC 异步测试边界约定
This commit is contained in:
@@ -649,17 +649,21 @@ export function registerDeveloperAgentWindowTests() {
|
||||
sourceSessionId: createdSessionId,
|
||||
title: '',
|
||||
});
|
||||
const refreshCallStart = invoke.mock.calls.length;
|
||||
fireEvent.click(screen.getByRole('button', { name: '刷新状态' }));
|
||||
expect(await screen.findByText('只属于新会话的问题')).not.toBeNull();
|
||||
await waitFor(() => {
|
||||
expect(invoke).toHaveBeenLastCalledWith(
|
||||
const runtimeReads = invoke.mock.calls
|
||||
.slice(refreshCallStart)
|
||||
.filter(([command]) => command === 'read_game_creator_agent_runtime');
|
||||
expect(runtimeReads.at(-1)).toEqual([
|
||||
'read_game_creator_agent_runtime',
|
||||
{
|
||||
projectPath: '/tmp/authorized-game',
|
||||
agentId: 'design-director',
|
||||
sessionId: archivedForkedSessionId,
|
||||
},
|
||||
);
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5615,3 +5615,4 @@ Cocos Creator 根目录由 `package.json.creator.version` 与普通 `assets/`
|
||||
- 在 hook 内运行临时仓库测试时,`cwd` 不会覆盖继承的 `GIT_DIR`、`GIT_WORK_TREE` 或 `GIT_INDEX_FILE`。未隔离的 Git/lint-staged 子进程可能向真实仓库提交 fixture,甚至把测试版 ESLint、Prettier 配置带入主分支。
|
||||
- fixture 子进程统一清除 `GIT_*` 环境,并用一次性外层 linked worktree 验证引用、索引、配置不变;原有工程检查规则保持完整,不能用逐项关闭规则修复 fixture 污染。
|
||||
- Vitest 的 `toHaveBeenCalledWith` 匹配任意一次调用,失败输出会列出其它命令;应先定位相同命令的真实参数差异,不能由其它调用的序号推断时序故障。
|
||||
- 存在后台轮询的 IPC mock 不应要求目标命令占据全局最后一次调用。验证刷新时先记录调用边界,再筛选该边界之后的目标命令,严格核对其最后一次参数,避免后台查询影响断言,也避免旧调用掩盖刷新未执行。
|
||||
|
||||
Reference in New Issue
Block a user