Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions examples/personal-workspace-browser/conversation-activity.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export const conversationActivityScenario = {
const turn = await send("请检查当前任务状态,并说明下一步。");
await page.getByRole("status", {name: "正在回复", exact: true}).waitFor();
const pending = page.locator(".personal-message").filter({ has: page.getByRole("button", { name: "中断本轮", exact: true }) });
await page.clock.install();
await page.clock.fastForward(25000);
// Compare the same instant across views; clock.install alone keeps
// advancing and can cross a second boundary while navigation completes.
await page.clock.pauseAt(await page.evaluate(() => Date.now()));
const clockStart = await page.evaluate(() => Date.now());
await page.clock.install({time: clockStart});
// Pause at one anchored future instant; an observed current time can
// already be in the past when the browser receives the next command.
await page.clock.pauseAt(clockStart + 25000);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 安装后时钟仍在走,未来25秒目标仍可被追过。准确head的同一实际Playwright1.62.1 clock序列在500ms延迟通过,但25,250ms后暂停前已到起点后25,251ms,pauseAt(clockStart+25000)仍抛Cannot fast-forward to the past,场景在quiet与导航断言前退出。请真正固定比较所用Date,保留定时器推进及比较后的系统时间恢复,再运行短/长延迟与完整场景;不要继续扩大常量。当前main已有同义25秒策略,也不能当作无竞态控制组;应整合为同一处有效修复或关闭已覆盖提案。

await pending.locator(".personal-message-quiet").waitFor();
const elapsedBefore = await pending.locator(".personal-message-elapsed").textContent();
await page.getByRole("navigation", { name: "管家视图" }).getByRole("button", { name: "总览", exact: true }).click();
Expand Down
Loading