Skip to content

Cap the liquid-test polling interval at 5 seconds#263

Open
Benjvandam wants to merge 1 commit into
mainfrom
cap-test-polling-interval
Open

Cap the liquid-test polling interval at 5 seconds#263
Benjvandam wants to merge 1 commit into
mainfrom
cap-test-polling-interval

Conversation

@Benjvandam

Copy link
Copy Markdown
Contributor

Why

fetchResult grows the poll delay 5% per poll with no cap. For long test runs that means:

elapsed poll interval
60s ~4s
5 min ~15s
10 min ~30s
20 min ~60s
~33 min (waitingLimit) ~100s

A liquid test that takes ~10 minutes server-side (observed in be_market CI, e.g. run 28656835005: a single test, 9m51s) is only checked every ~30s by then, so a finished run sits unnoticed for up to a minute. In CI batches that detection lag multiplies.

What

Cap the delay at 5 seconds (reached after ~70s of polling). Detection lag is now bounded at 5s; short runs poll exactly as before, and the steady-state request rate is at most one readTestRun per 5s per run.

Validation

  • New unit test drives a 60-poll run through fake timers and asserts the maximum setTimeout delay is exactly 5000ms (cap reached, never exceeded).
  • Full suite: 566/566 pass.

Context: follow-up from silverfin/bso_github_actions#28 (CI-side retries + parallel firms) — this is the CLI-side piece of the latency work.

The delay between result polls grows 5% per poll with no upper bound, so a
long test run (~10 minutes server-side) ends up being checked only every
30-60 seconds - a finished run can sit unnoticed for up to a minute, and
in CI that lag multiplies across batches. Cap the delay at 5s: at most one
poll per 5 seconds per run (reached after ~70s), bounding the detection
lag without meaningfully increasing request volume for short runs.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18ba2d75-f6e9-41cc-99ae-3006772e69f2

📥 Commits

Reviewing files that changed from the base of the PR and between 258e6b7 and 5228b01.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • CHANGELOG.md
  • lib/liquidTestRunner.js
  • package.json
  • tests/TESTS.md
  • tests/lib/liquidTestRunner.test.js

Walkthrough

This PR caps the exponential polling backoff delay in liquid test result fetching at 5000ms using Math.min, preventing excessively long polling gaps during long-running tests. Includes a corresponding unit test, documentation updates, changelog entry, and package version bump to 1.56.4.

Changes

Polling Delay Cap

Layer / File(s) Summary
Cap polling delay implementation
lib/liquidTestRunner.js
Adds a maxPollingDelay constant (5000ms) and updates pollingDelay calculation to Math.min(pollingDelay * 1.05, maxPollingDelay), bounding backoff growth in fetchResult.
Test coverage and documentation
tests/lib/liquidTestRunner.test.js, tests/TESTS.md, CHANGELOG.md, package.json
Adds a runTests test verifying the setTimeout delay caps at 5000ms on long-running tests, documents the behavior, adds a changelog entry, and bumps version to 1.56.4.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Related PRs: None identified.

Suggested labels: bug, tests

Suggested reviewers: None identified.

🐰 A hop, a poll, a gentle cap,
No more delays that overlap,
Five seconds max, the wait is bound,
Tests run smooth, no lag around!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: capping the liquid-test polling interval at 5 seconds.
Description check ✅ Passed The PR description includes motivation, change summary, and validation, but it doesn't follow the template headings exactly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cap-test-polling-interval

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@michieldegezelle michieldegezelle self-assigned this Jul 6, 2026
@michieldegezelle michieldegezelle self-requested a review July 6, 2026 12:06
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