Skip to content

fix(tests/resilience): wait out 60s presence TTL in link-offline assertion - #3703

Merged
tlgimenes merged 2 commits into
mainfrom
tlgimenes/fix-resilience-tests
Jun 8, 2026
Merged

tlgimenes merged 2 commits into
mainfrom
tlgimenes/fix-resilience-tests

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

What is this contribution about?

The Resilience Tests suite has failed on main on every run since #3698 (2026-06-07), always on sandbox↔studio WS partition > WS severed → link offline. #3698 deleted the reverse-WebSocket daemon transport and made HTTP pull the only transport, so the link claim is now a studio_links NATS KV entry with a 60s TTL re-armed on every work/control/proxy poll — not a socket whose close releases the claim in seconds — but the test still polled /api/links/me === null with a 30s budget, so it timed out deterministically (30s < 60s). This PR raises the offline-poll budget past the TTL (30s → 80s), bumps the affected sub-test timeouts, and rewrites the now-misleading "WS close" comments to describe the pull-transport presence model; the same TTL fix is applied to the (already-skipped) link-dispatch-log-replay scenario so it won't re-break when un-skipped.

Screenshots/Demonstration

N/A — test-only change.

How to Test

  1. docker compose -f tests/resilience/docker-compose.yml up -d --build --wait
  2. bun test tests/resilience/scenarios/link-dispatch-ws-partition.test.ts --serial --timeout 900000
  3. Expected: all three sub-tests pass — WS severed → link offline now waits up to ~60s for the presence claim to expire instead of failing at 30s.
  4. docker compose -f tests/resilience/docker-compose.yml down -v

Migration Notes

None — no production code, schema, or config changes (test timeouts/comments only).

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by cubic

Fixes failing resilience tests by waiting out the 60s presence TTL, and deflakes two e2e tests by relaxing timeouts and using a reachable test URL.

  • Bug Fixes
    • Resilience: wait for the 60s KV presence TTL before asserting link-offline (poll budget 30s → 80s, 1s interval), bump sub-test timeouts (90s → 150s, 240s → 300s), and update comments to reflect the pull-transport presence model; apply the same TTL wait to the skipped log-replay scenario.
    • E2E: chat-input-draft uses a 15s toHaveText timeout to accommodate Tiptap rendering (5s → 15s); clonable-agent-logo creates the placeholder HTTP connection with a reachable test URL (http://127.0.0.1:3000/ instead of http://127.0.0.1:1).

Written for commit 923e4c2. Summary will update on new commits.

Review in cubic

…ine assertion

The daemon↔studio transport flipped from reverse-WS to pure pull (#3698), so the
link claim is now a `studio_links` KV entry with a 60s TTL re-armed on every
work/control/proxy poll — not a socket whose close releases the claim in a few
seconds. The ws-partition scenario still polled `/api/links/me === null` with a
30s budget, so it timed out deterministically once the WS transport was gone
(every run since #3698 failed on `WS severed → link offline`).

Raise the offline-poll budget past the TTL (30s → 80s), bump the affected
sub-test timeouts, and correct the now-misleading "WS close" comments to describe
the pull-transport presence model. Apply the same TTL fix to the skipped
log-replay scenario so it doesn't re-break when un-skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@tlgimenes
tlgimenes enabled auto-merge (squash) June 8, 2026 13:37
Two e2e test failures due to timing/infrastructure issues:

1. chat-input-draft.spec.ts (line 48): typeInComposer's toHaveText() was
   timing out at 5s before Tiptap had time to render the full text under CI
   load. Increase timeout to 15s to accommodate Tiptap's DOM updates.

2. clonable-agent-logo.spec.ts (line 22): HTTP connection creation was failing
   with a 500 error because the backend now validates HTTP endpoints, and the
   test was using an intentionally unreachable URL (127.0.0.1:1). Use the
   actual test server at localhost:3000 instead — we only need the connection
   ID for the test, not a functional endpoint.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@tlgimenes
tlgimenes merged commit 8696d53 into main Jun 8, 2026
17 checks passed
@tlgimenes
tlgimenes deleted the tlgimenes/fix-resilience-tests branch June 8, 2026 13:51
decocms Bot pushed a commit that referenced this pull request Jun 8, 2026
PR: #3703 fix(tests/resilience): wait out 60s presence TTL in link-offline assertion
Bump type: patch

- decocms (apps/mesh/package.json): 2.398.0 -> 2.398.1
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.

1 participant