Skip to content

Add request timeout handling and reduce CI test retries#453

Merged
kevinchappell merged 1 commit into
mainfrom
claude/fix-playwright-test-hang-0oy8m
May 16, 2026
Merged

Add request timeout handling and reduce CI test retries#453
kevinchappell merged 1 commit into
mainfrom
claude/fix-playwright-test-hang-0oy8m

Conversation

@kevinchappell
Copy link
Copy Markdown
Collaborator

Summary

This PR improves the robustness of AJAX requests by adding configurable timeout support and reduces unnecessary test retries in CI environments.

Key Changes

  • AJAX timeout support: Added AJAX_TIMEOUT_MS constant (10 seconds default) and a timeoutMs parameter to the ajax() function. Uses the native AbortSignal.timeout() API when available for automatic request cancellation.
  • Error handling fix: Changed .catch() to resolve with onError() result instead of rejecting, ensuring consistent error handling behavior.
  • CI test retries: Reduced Playwright test retries from 2 to 1 on CI to speed up feedback loops while maintaining reasonable reliability.

Implementation Details

  • The timeout implementation gracefully degrades: if AbortSignal.timeout() is not available (older environments), the signal is undefined and fetch proceeds without timeout.
  • The error handling change ensures that network errors are properly caught and passed to the error callback, with the promise always resolving rather than rejecting.

https://claude.ai/code/session_012w1wEVswQvBsQPEeaXwZvW

Copilot AI review requested due to automatic review settings May 16, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds timeout handling to AJAX fetches used by Formeo resource loading and reduces CI Playwright retries to speed up feedback.

Changes:

  • Added a default AJAX_TIMEOUT_MS and optional timeoutMs parameter to ajax().
  • Uses AbortSignal.timeout() when available and resolves error handling through onError().
  • Reduced CI Playwright retries from 2 to 1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/lib/js/common/loaders.js Adds configurable fetch timeout support and resolves fetch errors through the error callback.
playwright.config.js Lowers CI retry count for Playwright tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Base automatically changed from feat/controls-container to main May 16, 2026 17:48
…ries

- Add 10s timeout via AbortSignal to ajax() in loaders so a slow or
  blocked CDN cannot stall editor init for the full per-test timeout.
- Resolve the ajax promise from the catch handler so failed fallback
  fetches no longer leave callers waiting forever.
- Reduce CI retries from 2 to 1 to cap the cost of flaky tests.
@kevinchappell kevinchappell force-pushed the claude/fix-playwright-test-hang-0oy8m branch from 36df3b7 to 40918bc Compare May 16, 2026 17:50
@kevinchappell kevinchappell merged commit 8ce1bc5 into main May 16, 2026
2 checks passed
@kevinchappell kevinchappell deleted the claude/fix-playwright-test-hang-0oy8m branch May 16, 2026 17:51
@kevinchappell
Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants