Skip to content

test(desktop): eliminate the Settings/titlebar rename Escape race #3728

Description

@M4n5ter
English

What happened

The Desktop E2E test opening settings commits an active titlebar rename is intermittent on Linux CI. After the test opens Settings while a titlebar rename is active and presses Escape, [data-maka-contract="titlebar-identity"] sometimes remains absent for the full 10-second assertion budget.

Expected behavior: once Settings is visible, one Escape closes it and the titlebar identity reappears with the committed name.

Observed behavior: the identity occasionally does not reappear. The same SHA passes when the CI job is rerun and passes as an isolated real-Electron test after a clean Desktop build, so this is a timing-dependent contract rather than a deterministic regression.

How to reproduce

Run the existing test on the built Desktop application:

npm --workspace @maka/desktop run build
npm exec -w @maka/desktop -- playwright test --config e2e/playwright.config.ts e2e/settings.spec.ts --grep "opening settings commits an active titlebar rename"

The failure is intermittent. The failing sequence is:

  1. Create a Session.
  2. Start an inline rename from the titlebar identity.
  3. Enter a new name.
  4. Programmatically activate Settings while the rename input retains focus.
  5. Wait for Settings to become visible.
  6. Press Escape once.
  7. Observe that the titlebar identity sometimes remains unmounted.

Environment

  • Maka commit: 82ba73f3bb30f2de2670f22fdb1d8471cb245ab8
  • OS: GitHub-hosted Linux runner under Xvfb
  • Surface: Desktop Electron E2E
  • Test: apps/desktop/e2e/settings.spec.ts:39

Logs, screenshots, or additional context

The fix should establish which owner consumes Escape during the Settings transition and wait on the resulting observable state. Increasing the assertion timeout or adding a retry would hide the race rather than define the interaction contract.

简体中文

发生了什么

Desktop E2E 测试 opening settings commits an active titlebar rename 在 Linux CI 上存在间歇性失败。测试在标题栏重命名进行中打开 Settings 并按下 Escape 后,[data-maka-contract="titlebar-identity"] 偶尔在完整的 10 秒断言预算内都没有重新出现。

预期行为:Settings 可见后,按一次 Escape 会关闭 Settings,标题栏 identity 重新出现并显示已经提交的新名称。

实际行为:identity 偶尔不会重新出现。同一个 SHA 在 CI 重跑时通过,完整构建 Desktop 后单独运行同一条真实 Electron 测试也通过,因此这是一个依赖时序的交互契约问题,而不是确定性回归。

如何复现

在已构建的 Desktop 应用上运行现有测试:

npm --workspace @maka/desktop run build
npm exec -w @maka/desktop -- playwright test --config e2e/playwright.config.ts e2e/settings.spec.ts --grep "opening settings commits an active titlebar rename"

该失败是间歇性的。失败序列如下:

  1. 创建一个 Session。
  2. 从标题栏 identity 开始行内重命名。
  3. 输入新名称。
  4. 在重命名输入框仍持有焦点时,通过程序方式激活 Settings。
  5. 等待 Settings 可见。
  6. 按一次 Escape。
  7. 标题栏 identity 偶尔仍处于卸载状态。

环境

  • Maka commit:82ba73f3bb30f2de2670f22fdb1d8471cb245ab8
  • OS:GitHub 托管的 Linux runner,使用 Xvfb
  • Surface:Desktop Electron E2E
  • 测试:apps/desktop/e2e/settings.spec.ts:39

日志、截图或其他上下文

修复应明确 Settings 过渡期间由哪个 owner 消费 Escape,并等待最终可观察状态。增加断言 timeout 或 retry 只会掩盖竞态,不能定义交互契约。

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions