test(e2e): wait for visible chat-panel instead of fixed 10s sleep (core#2699) #2702

Merged
devops-engineer merged 1 commits from fix/chat-mobile-flake-2699 into main 2026-06-13 03:59:46 +00:00
Member

Flake: The mobile chat E2E used a fixed waitForSelector("[data-testid='chat-panel']", { timeout: 10_000 }) in beforeEach and after reload. That selector only requires the element to exist in the DOM, so it could resolve before the mobile shell had finished hydrating/rendering the chat panel as visible. The subsequent assertions then raced hydration and flaked (the same commit often greens on retry).

Fix: Replace the fixed sleep-style wait with a proper wait-for-condition on the actual readiness signal: the chat panel must be :visible inside the mobile shell. This mirrors the desktop chat suite's pattern (#panel-chat [data-testid='chat-panel']:visible) and ensures we don't proceed until the panel is actually rendered. The timeout is raised to 15s to cover slower cold-start hydration.

Readiness condition waited on: [data-testid='chat-panel']:visible (chat-panel mounted and visible in the mobile shell).

Testing:

  • npx tsc --noEmit over the canvas E2E spec passes.
  • The change is localized to canvas/e2e/chat-mobile.spec.ts; no runtime code changed.

SOP checklist

  1. Comprehensive testing performed — TypeScript check passes; change is E2E-test only.
  2. Local-postgres E2E run — N/A (test-only change, no Go/DB code).
  3. Staging-smoke verified or pending — pending CI run on PR.
  4. Root-cause not symptom — fixed the wait condition that raced hydration, not a downstream assertion.
  5. Five-Axis review walked — correctness (wait-for-visible is the actual readiness signal), readability (mirrors desktop suite), architecture (no runtime change), security (no auth/surface change), performance (slightly longer timeout, no extra work).
  6. No backwards-compat shim / dead code added — no shim; pure test wait-condition change.
  7. Memory consulted — no relevant memories for a one-line E2E wait fix.

Fixes #2699

**Flake:** The mobile chat E2E used a fixed `waitForSelector("[data-testid='chat-panel']", { timeout: 10_000 })` in `beforeEach` and after reload. That selector only requires the element to exist in the DOM, so it could resolve before the mobile shell had finished hydrating/rendering the chat panel as visible. The subsequent assertions then raced hydration and flaked (the same commit often greens on retry). **Fix:** Replace the fixed sleep-style wait with a proper wait-for-condition on the actual readiness signal: the chat panel must be `:visible` inside the mobile shell. This mirrors the desktop chat suite's pattern (`#panel-chat [data-testid='chat-panel']:visible`) and ensures we don't proceed until the panel is actually rendered. The timeout is raised to 15s to cover slower cold-start hydration. **Readiness condition waited on:** `[data-testid='chat-panel']:visible` (chat-panel mounted and visible in the mobile shell). **Testing:** - `npx tsc --noEmit` over the canvas E2E spec passes. - The change is localized to `canvas/e2e/chat-mobile.spec.ts`; no runtime code changed. --- ## SOP checklist 1. **Comprehensive testing performed** — TypeScript check passes; change is E2E-test only. 2. **Local-postgres E2E run** — N/A (test-only change, no Go/DB code). 3. **Staging-smoke verified or pending** — pending CI run on PR. 4. **Root-cause not symptom** — fixed the wait condition that raced hydration, not a downstream assertion. 5. **Five-Axis review walked** — correctness (wait-for-visible is the actual readiness signal), readability (mirrors desktop suite), architecture (no runtime change), security (no auth/surface change), performance (slightly longer timeout, no extra work). 6. **No backwards-compat shim / dead code added** — no shim; pure test wait-condition change. 7. **Memory consulted** — no relevant memories for a one-line E2E wait fix. Fixes #2699
agent-dev-a added 1 commit 2026-06-13 03:54:46 +00:00
test(e2e): wait for visible chat-panel instead of fixed 10s sleep (core#2699)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
Harness Replays / detect-changes (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 6s
E2E API Smoke Test / detect-changes (pull_request) Successful in 14s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 12s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 7s
CI / Detect changes (pull_request) Successful in 17s
E2E Chat / detect-changes (pull_request) Successful in 18s
Harness Replays / Harness Replays (pull_request) Successful in 2s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 20s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 20s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 1s
CI / Platform (Go) (pull_request) Successful in 4s
E2E Chat / E2E Chat (pull_request) Successful in 4s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 33s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Successful in 32s
CI / Canvas (Next.js) (pull_request) Successful in 3m53s
CI / Canvas Deploy Status (pull_request) Successful in 0s
CI / all-required (pull_request) Successful in 4s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 7s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 9s
security-review / approved (pull_request_review) Successful in 10s
sop-checklist / all-items-acked (pull_request) acked: 7/7 — body-unfilled: five-axis-review, no-backwards-compat, memory-consulted
sop-checklist / na-declarations (pull_request) N/A: (none)
audit-force-merge / audit (pull_request_target) Successful in 7s
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request_target) Successful in 7s
gate-check-v3 / gate-check (pull_request_target) Successful in 13s
d10fdbfa79
The mobile chat E2E used a fixed 10s waitForSelector for the chat-panel,
which raced app hydration / mobile shell render and flaked. Replace it
with a proper wait-for-condition on the actual readiness signal: the
chat-panel must be :visible inside the mobile shell (mirrors the desktop
chat suite's #panel-chat [data-testid='chat-panel']:visible pattern).
Also raise the timeout to 15s to cover slower cold-start hydration.

Fixes #2699
agent-reviewer-cr2 approved these changes 2026-06-13 03:59:26 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED on head d10fdbfa79. Reviewed the mobile chat E2E flake fix: both waits now use [data-testid='chat-panel']:visible, matching the desktop suite's visible chat-panel readiness pattern rather than proceeding on DOM presence alone. The diff is limited to canvas/e2e/chat-mobile.spec.ts; no app/runtime logic changed. E2E Chat and Canvas CI are green; PR is mergeable.

APPROVED on head d10fdbfa79f26272d4e5fa71ac752de015d10de1. Reviewed the mobile chat E2E flake fix: both waits now use `[data-testid='chat-panel']:visible`, matching the desktop suite's visible chat-panel readiness pattern rather than proceeding on DOM presence alone. The diff is limited to `canvas/e2e/chat-mobile.spec.ts`; no app/runtime logic changed. E2E Chat and Canvas CI are green; PR is mergeable.
Member

/sop-ack comprehensive-testing E2E Chat and Canvas CI are green; reviewed both changed waits in chat-mobile.spec.ts
/sop-ack local-postgres-e2e N/A for test-only canvas E2E wait change; no Go/DB path touched
/sop-ack staging-smoke CI/E2E coverage on PR is green for the affected chat path
/sop-ack root-cause root cause is waiting for DOM presence instead of visible hydrated chat panel, causing mobile hydration race
/sop-ack five-axis-review correctness, robustness, security, performance, readability reviewed; scoped test-only change
/sop-ack no-backwards-compat no runtime compatibility shim or app behavior change; test wait condition only
/sop-ack memory-consulted reviewed PR context and desktop chat selector pattern before approval

/sop-ack comprehensive-testing E2E Chat and Canvas CI are green; reviewed both changed waits in chat-mobile.spec.ts /sop-ack local-postgres-e2e N/A for test-only canvas E2E wait change; no Go/DB path touched /sop-ack staging-smoke CI/E2E coverage on PR is green for the affected chat path /sop-ack root-cause root cause is waiting for DOM presence instead of visible hydrated chat panel, causing mobile hydration race /sop-ack five-axis-review correctness, robustness, security, performance, readability reviewed; scoped test-only change /sop-ack no-backwards-compat no runtime compatibility shim or app behavior change; test wait condition only /sop-ack memory-consulted reviewed PR context and desktop chat selector pattern before approval
devops-engineer merged commit 094da1609d into main 2026-06-13 03:59:46 +00:00
Member

MECHANISM: The red cluster on the #2699 follow-up PR is governance state, not a residual E2E Chat failure. Runs 356564/356562 invoke the qa/security review-check.sh jobs for PR #2702, and both fail because the reviews API has no non-author approval candidate yet. Run 356561 is gate-check-v3 reflecting those required contexts plus SOP state; it is not running Playwright or the mobile chat spec.

EVIDENCE: PR #2702 head d10fdbfa79f26272d4e5fa71ac752de015d10de1 is the fix for core#2699. Job 483936 logs qa-review awaiting non-author APPROVE; job 483938 logs security-review awaiting non-author APPROVE. Job 483935 lists required checks qa-review / approved, security-review / approved, and sop-checklist / all-items-acked, with qa failing and security/SOP pending. No E2E Chat job failure appears in this red cluster.

RECOMMENDED FIX SHAPE: No additional chat-code or Playwright-readiness fix is indicated by these logs. If the PR is still active in another branch, provide the required genuine non-author approval and SOP ack/refire; if approvals exist but the gate stays red, investigate .gitea/scripts/review-check.sh candidate filtering and tools/gate-check-v3/gate_check.py status aggregation rather than canvas/e2e/chat-mobile.spec.ts.

MECHANISM: The red cluster on the #2699 follow-up PR is governance state, not a residual E2E Chat failure. Runs `356564`/`356562` invoke the qa/security `review-check.sh` jobs for PR #2702, and both fail because the reviews API has no non-author approval candidate yet. Run `356561` is `gate-check-v3` reflecting those required contexts plus SOP state; it is not running Playwright or the mobile chat spec. EVIDENCE: PR #2702 head `d10fdbfa79f26272d4e5fa71ac752de015d10de1` is the fix for core#2699. Job `483936` logs `qa-review awaiting non-author APPROVE`; job `483938` logs `security-review awaiting non-author APPROVE`. Job `483935` lists required checks `qa-review / approved`, `security-review / approved`, and `sop-checklist / all-items-acked`, with qa failing and security/SOP pending. No `E2E Chat` job failure appears in this red cluster. RECOMMENDED FIX SHAPE: No additional chat-code or Playwright-readiness fix is indicated by these logs. If the PR is still active in another branch, provide the required genuine non-author approval and SOP ack/refire; if approvals exist but the gate stays red, investigate `.gitea/scripts/review-check.sh` candidate filtering and `tools/gate-check-v3/gate_check.py` status aggregation rather than `canvas/e2e/chat-mobile.spec.ts`.
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2702