Skip to content

test(core): fix error message assertions and unskip withExponentialBackoff tests#12530

Open
mian-abd wants to merge 1 commit into
continuedev:mainfrom
mian-abd:test-with-exponential-backoff
Open

test(core): fix error message assertions and unskip withExponentialBackoff tests#12530
mian-abd wants to merge 1 commit into
continuedev:mainfrom
mian-abd:test-with-exponential-backoff

Conversation

@mian-abd
Copy link
Copy Markdown

@mian-abd mian-abd commented Jun 1, 2026

Description

core/util/withExponentialBackoff.ts is the retry helper wrapping every LLM call in core/llm/index.ts (chat fetch + embeddings). Its test file was skipped wholesale via describe.skip because two assertions used an incorrect expected error string: "Failed to make API call after max tries" is not a substring of the actual implementation message "Failed to make API call after ${maxTries} retries".

This PR:

  1. Fixes the two assertion strings to match the actual error message (uses the stable prefix "Failed to make API call after").
  2. Removes describe.skip so all 6 existing tests run.
  3. Adds 3 new tests covering the previously-untested retry triggers in the implementation: "overloaded" substring, "malformed json" substring, and "code": 429 JSON-body regex.

No implementation code is changed.

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created — N/A (test-only)
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

N/A — test-only change with no user-visible behavior.

Tests

All changes are in core/util/withExponentialBackoff.test.ts. Verified locally via cd core && npm test -- withExponentialBackoff — 9 tests pass (6 previously-skipped + 3 new). ESLint and Prettier clean.


Summary by cubic

Fixes and re-enables the withExponentialBackoff test suite, and adds coverage for key retry conditions. Test-only; no runtime changes.

  • Bug Fixes

    • Matched expected error string to the stable prefix “Failed to make API call after”.
    • Unskipped the suite so all existing tests run.
  • New Features

    • Added tests for retry triggers: “overloaded”, “malformed json”, and JSON body with "code": 429.

Written for commit 8bc8d02. Summary will update on new commits.

Review in cubic

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 1, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant