Skip to content

test(cypress): give server round trips room in the specs that wait on them - #866

Open
joewiz wants to merge 1 commit into
eXist-db:developfrom
joewiz:test/harden-first-request-timeouts
Open

test(cypress): give server round trips room in the specs that wait on them#866
joewiz wants to merge 1 commit into
eXist-db:developfrom
joewiz:test/harden-first-request-timeouts

Conversation

@joewiz

@joewiz joewiz commented Aug 19, 2026

Copy link
Copy Markdown
Member

[This PR was prompted by Joe, drafted by Claude Code, and reviewed by Joe.]

Problem

Several assertions wait on a server round trip while using Cypress's 4-second default (or a hand-set 5 seconds). That is comfortable on a warm instance and tight on a loaded CI runner or a freshly started container, so these specs fail intermittently and are then hard to distinguish from real regressions — which is exactly what made the reports in #821 so hard to act on.

Three sightings, all of which passed on an immediate re-run:

spec assertion where
autocomplete_spec .cm-tooltip-autocomplete after "shows repo: completions when typing repo without colon" #865's first CI run
apply_configuration save dialog closed, first save against a cold container local full-suite run
websocket_spec diagnostics push after compile local full-suite run

The autocomplete one also appears in the failure tables reported in #821.

Change

Raise the timeout only on assertions that are waiting on the server, and say so in a comment where it is not obvious:

  • 10s — the completion popup (served by the language service), the save dialog opening and closing, the "stored" / "Configuration applied." toasts, and the path label after a save
  • 15swebsocket_spec's diagnostics assertion, which waits for a compile request and a push back over the socket

Assertions that only wait on local DOM work are left at their existing values; this is not a blanket bump.

Verification

Full suite on the stack the eXist-db image bundles (eXist-db 7.0.0-SNAPSHOT, existdb-openapi 0.10.0, Roaster 1.12.2), clean container: the three specs above pass, and the suite is otherwise unchanged from develop.

… them

Several assertions wait on a server round trip while using Cypress's 4s default
(or a hand-set 5s). That is comfortable against a warm instance and tight on a
loaded runner or a cold container, so the specs fail intermittently and the
failures are hard to tell apart from real regressions — which is much of what
made the reports in eXist-db#821 hard to act on.

Three sightings, each passing on an immediate re-run: autocomplete's completion
popup for "repo" (eXist-db#865's first CI run, and also in eXist-db#821's tables),
apply_configuration's first save against a freshly started container, and
websocket_spec's diagnostics push.

Raise the timeout only where the assertion is waiting on the server: 10s for the
completion popup, the save dialog opening and closing, the save toasts and the
path label; 15s for the WebSocket diagnostics assertion, which waits for a
compile request and then a push back over the socket. Assertions that wait only
on local DOM work keep their existing values.

Verified on the stack the eXist-db image bundles (7.0.0-SNAPSHOT, existdb-openapi
0.10.0, Roaster 1.12.2): 261 tests, the three specs above green, and the only
failure is query_error_structured, which eXist-db#840 fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@duncdrum duncdrum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There are two leaner option:

  • adjust the default timeouts in cypress config, instead of per testcase
  • configure retries in cypress configs (this works really well in my experience) to get rid of more flake

The third option (most work but best results):
Where possible make longer chains using cy.request with assertions on outgoing and request and incoming responses, where each one starts a new timeout window, and failures become much more informative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants