Skip to content

fix(workflow): leave room for retries in AI unit tests - #3436

Merged
quanru merged 6 commits into
mainfrom
fix/ai-unit-retry-budget
Nov 25, 2026
Merged

quanru merged 6 commits into
mainfrom
fix/ai-unit-retry-budget

Conversation

@quanru

@quanru quanru commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Set the AI unit workflow’s per-request timeout to 80 seconds and retry delay to 5 seconds. Keep two model retries.
  • Re-encode the 1280 × 800 Taobao test screenshot as JPEG at quality 85. Its size falls from 1,004,019 to 163,510 bytes. The existing fixture loader supports JPEG. The test code, prompts and assertions in packages/core/tests/ai/service/service.test.ts are identical to main.
  • After #3429 fixed the iOS test types on main, sync with main and retain its version. The final diff contains only the AI unit workflow and the Taobao screenshot replacement. Both the iOS and deep-locate test files are identical to the current base.

CI evidence

  • Current head b3af28926 includes main at 51c3046c4. The complete AI unit suite finished with 141 passed, 34 skipped. Both Taobao deep-locate cases and the web navigation case passed. All applicable PR checks passed and GitHub reports no merge conflict. AI unit suite · Regular CI

  • On the previous head e3fe20eb2: 141 passed, 34 skipped in the complete AI unit suite. Both deep-locate tests and the browser navigation test passed. All applicable PR workflows passed. The first AI run passed both deep-locate tests, then timed out capturing an external page in the separate Web test. Android and Chrome recorder each passed on a same-commit retry. Final AI suite · Regular CI · First AI run · Android retry · Recorder retry

  • On fix(core): normalize legacy YAML reference images into locate prompts #3419’s Todo case, holding the first model request open exhausted the old 180-second test budget. With the new configuration, a second request started at 85 seconds and returned HTTP 200 at 110 seconds. The original assertions and both healthy controls passed. Same-runner experiment

  • Against the original PNG, the config-only PR head had 139 passing tests, 2 failures and 34 skips. Both search-area tests exhausted three 80-second attempts on the initial uncropped screenshot. The web and CLI suites passed. Config-only full suite

  • On a single runner against the live Doubao 2.1 Turbo endpoint, we ran the original, unchanged service test file three times at the 80-second limit. JPEG passed 4/4 active cases, PNG failed both search-area cases, and JPEG passed 4/4 again. The two deep-locate cases took 46–65 seconds per case across the JPEG runs. Alternating fixture encoding

  • On two runners we replayed the same JPEG and prompt, changing only JSON whitespace and reversing the order. The 219 KB request completed in 33.5 and 35.9 seconds. At 1.34 MB the client recorded request-body transmission complete at 163.3 and 176.0 seconds, and received a full response at 171.1 and 197.9 seconds. All four responses were HTTP 200. Large request first · Small request first

Local verification

  • pnpm run lint
  • actionlint -shellcheck= -pyflakes= .github/workflows/ai-unit-test.yml
  • git diff --check origin/main...HEAD
  • pnpm exec nx build @midscene/ios
  • pnpm exec tsc --noEmit --pretty false -p packages/ios/tsconfig.json
  • pnpm exec nx test @midscene/ios -- tests/unit-test/input-readiness.test.ts
  • pnpm exec nx build @midscene/report and pnpm --filter @midscene/core sync-report-template to prepare the report template for core tests
  • pnpm exec nx test @midscene/core

@quanru
quanru marked this pull request as ready for review November 25, 2026 05:02
@quanru
quanru merged commit a0070f6 into main Nov 25, 2026
28 checks passed
@quanru
quanru deleted the fix/ai-unit-retry-budget branch November 25, 2026 14:13
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