Repository navigation
TEST: Make the open redirect ReDoS guard load-insensitive - #4801
Open
Richard Lundeen (richlundeen) wants to merge 2 commits into
Open
Richard Lundeen (richlundeen) wants to merge 2 commits into
Richard Lundeen (richlundeen) wants to merge 2 commits into
Conversation
Time only the compiled default patterns with time.thread_time() so busy CI workers and cold persistence cannot fail the 0.5s guard; keep the 8000-space payload and not-detected assertion. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… memory Measure score_text_async with time.thread_time() while CentralMemory returns a mocked MemoryInterface, so the ReDoS guard covers both compiled patterns and redirect-value normalization without counting persistence I/O or preemption. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the update reducing worker-load sensitivity in the open-redirect regression test.
No open issues 🎉
What changed in this PR
Makes the open-redirect ReDoS regression test less sensitive to worker load while preserving coverage of the public scoring path.
Changes:
- Uses caller-thread CPU time instead of elapsed wall-clock time.
- Mocks persistence while retaining the 8,000-character payload, negative-result assertion, and 0.5-second limit.
| File | Description |
|---|---|
tests/unit/score/regex/test_open_redirect_output_scorer.py |
Isolates scorer CPU work while preserving regex and normalization coverage. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Keep the pseudo-protocol padding ReDoS guard reliable on loaded Windows workers while preserving its full coverage of the public scoring path.