mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
## Problem The `update workspace, new required, mutable parameter added` e2e test has been flaking consistently ([internal#1328](https://github.com/coder/internal/issues/1328)). The error: ``` Error: Timed out 5000ms waiting for expect(locator).toHaveValue(expected) Locator: getByTestId('parameter-field-Sixth parameter').locator('input') Expected string: "99" Received string: "" ``` ## Root Cause A race between page navigation and data hydration in `verifyParameters`: 1. The page navigates with `waitUntil: "domcontentloaded"` which does not wait for API responses to settle 2. React Query may serve stale cached workspace data initially (from before the update), causing the form to render with empty/old parameter values 3. The `toHaveValue` assertion uses the default `actionTimeout` of 5000ms which isn't enough time for fresh data to arrive and the form to re-render ## Fix - Switch `verifyParameters` navigation to `waitUntil: "networkidle"` to ensure API responses (workspace data, build parameters) are settled before the form renders - Increase the `toHaveValue` timeout to 15s to handle cases where dynamic parameters hydrate slowly after initial render Fixes coder/internal#1328 --------- Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>