Skip to content

test: stabilize hostile HTML timing guard - #2603

Merged
lilyshen0722 merged 1 commit into
mainfrom
rivet/fix-html-to-text-timing
Oct 24, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
rivet/fix-html-to-text-timing

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Written by Rivet, a Commonly agent — https://commonly.me/v2/pods/6a692a1be833c668acdb84cf

Summary

  • Keep all six hostile 1 MB HTML input cases and their linear-time guard.
  • Replace the flaky 1-second wall-clock limit with a 5-second bound and a 10-second Jest timeout. The pre-fix quadratic scan was about two minutes at this size, so the assertion still catches that regression on a busy runner.

Evidence

  • Merge-group failure: docs: record 2026-10-23 staging connector walk #2536 at 08:26Z, <a case took 1074 ms against 1000 ms.
  • Focused Tier 0 suite: 15/15 pass (npm --prefix backend test -- --runInBand --watch=false __tests__/unit/services/htmlToText.test.js).
  • git diff --check passes.
  • Scoped ESLint still reports two pre-existing resolution errors at line 1 for the JS test's extensionless TS service import; this diff does not touch that import.

Test-only change. Request CodeRabbit review and green CI before merge.

Co-authored-by: rivet <WyJyaXZldCIsImRlZmF1bHQiXQ@agents.commonly.invalid>
Agent-Model: codex/gpt-6-sol/medium
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 259499e and 892ccae.

Files selected for processing: 1
  • backend/__tests__/unit/services/htmlToText.test.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Walkthrough

The 1 MB hostile-input test now allows up to five seconds for input reduction and sets its timeout to 10 seconds.

Changes: Hostile-input test timing

Layer / File(s) Summary
Adjust hostile-input timing
backend/__tests__/unit/services/htmlToText.test.js
The test allows up to five seconds for input reduction, documents scheduling headroom and the former scan duration, and sets a 10-second timeout.

Priority: Low

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

Change: Other

Merge Risk: Minimal · up to 892cc

No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: stabilizing the hostile HTML timing guard in a test.
Description check Passed The description directly explains the test-only timing adjustment, retained hostile-input cases, validation results, and known pre-existing lint errors.
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@lilyshen0722
lilyshen0722 marked this pull request as ready for review October 24, 2026 09:17

@lilyshen0722 lilyshen0722 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TIER 0 PRESS CHECK @ 892ccae

This is test-only: backend/__tests__/unit/services/htmlToText.test.js is the only file changed. The wall-clock bound goes from 1 s to 5 s, with a 10 s jest timeout. The old quadratic path took about two minutes, so the test still catches it. CodeRabbit found no actionable issues (cr-unanswered.sh 2603 → 0), and every required check is green.

GATE: PASS

@lilyshen0722
lilyshen0722 added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit c5e6411 Oct 24, 2026
30 checks passed
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.

1 participant