Skip to content

Increase metrics test timeouts and retries for CI reliability - #2408

Closed
iangmaia wants to merge 5 commits into
trunkfrom
iangmaia/increase-metrics-timeout
Closed

Increase metrics test timeouts and retries for CI reliability#2408
iangmaia wants to merge 5 commits into
trunkfrom
iangmaia/increase-metrics-timeout

Conversation

@iangmaia

@iangmaia iangmaia commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Fixes AINFRA-1760

Summary

A few more changes after seeing performance metrics failing once again after #2407 got merged to trunk: https://buildkite.com/automattic/studio/builds/10600.

The metrics test (site-editor.test.ts) has been consistently failing on trunk builds due to slow site creation on CI infrastructure:

  • Build 10600: Metrics failed at line 45 (site content heading timeout after 120s)
  • Build 10591: Metrics failed
  • Build 10588: Metrics failed (even with manual retry)
  • Build 10583: Metrics failed (even with 2 manual retries)

Changes

  1. Increased timeouts from 120s to 180s for slow operations:

    • App startup (onboarding heading visibility)
    • Site creation (site name heading visibility)
    • Site running state (running button attached)
  2. Increased retries from 1 to 2 in metrics playwright config to handle CI infrastructure variability

Test Plan

  • Verify CI passes on this PR
  • Monitor trunk builds after merge

🤖 Generated with Claude Code

@iangmaia iangmaia self-assigned this Jan 16, 2026
@iangmaia
iangmaia requested a review from wojtekn January 16, 2026 12:33
iangmaia and others added 5 commits January 16, 2026 16:17
The metrics test consistently fails on CI due to slow site creation.
Analysis of recent trunk builds shows this is infrastructure variability,
not a code bug. Increasing timeouts from 120s to 180s and retries from
1 to 2 should handle the occasional slow CI runs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add debugLog helper function for timestamped logging
- Capture screenshots on failure at critical points (onboarding, site content)
- Increase timeouts by 50% for CI stability:
  - Global test timeout: 180s → 270s
  - Action timeout: 60s → 90s
  - Expect timeout: 30s → 45s
  - Iframe wait: 120s → 180s
  - Block selector wait: 60s → 90s
  - Onboarding/site content waits: 180s → 270s

This addresses intermittent CI failures where the app startup or site
creation takes longer than expected on some CI runners.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enable 'only-on-failure' screenshots in Playwright config
- Add waitForWithScreenshots() helper that takes screenshots every 30s
  while waiting for site content heading
- Add *.png to metrics artifact paths to upload screenshots
- This will help diagnose what's on screen during the ~4 minute hang

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Write screenshots as actual PNG files to ARTIFACTS_PATH
- Reduce effective timeout to 240s to avoid race with test timeout
- Log screenshot file paths for easier debugging
- This ensures screenshots get uploaded as build artifacts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@iangmaia
iangmaia force-pushed the iangmaia/increase-metrics-timeout branch from 5fe1cf0 to 67d9da5 Compare January 16, 2026 15:18
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 67d9da5 vs trunk

site-editor

Metric trunk 67d9da5 Diff Change
load 2911.00 ms 2918.00 ms +7.00 ms 🔴 0.2%

site-startup

Metric trunk 67d9da5 Diff Change
siteCreation 7065.00 ms 7076.00 ms +11.00 ms 🔴 0.2%
siteStartup 3946.00 ms 3939.00 ms -7.00 ms 🟢 -0.2%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@iangmaia

Copy link
Copy Markdown
Contributor Author

Closing -- the Performance Metrics tests seem good after merging #2398.

@iangmaia iangmaia closed this Jan 16, 2026
@iangmaia
iangmaia deleted the iangmaia/increase-metrics-timeout branch January 16, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants