-
Notifications
You must be signed in to change notification settings - Fork 81
Add unit test coverage for adaptive concurrency throttling #330
Copy link
Copy link
Closed
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewards
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewards
Difficulty: Intermediate
Type: Test
Recommended labels (if available in this repo):
tests,sdkBackground
src/access/adaptiveConcurrency.tsimplements some form of concurrency throttling for access checks, but based on the repository structure there is no dedicated test file covering its throttling behavior.Problem
Without test coverage, changes to the throttling algorithm (or accidental regressions from unrelated refactors) could silently break backpressure behavior, risking either RPC overload or unnecessary throttling under normal load.
Expected Outcome
A comprehensive Vitest suite for
adaptiveConcurrency.tscovering its core throttling logic under simulated load patterns.Suggested Implementation
Read through
adaptiveConcurrency.tsto identify its current algorithm (e.g. concurrency window, in-flight request counting, backoff triggers). Write tests that simulate bursts of concurrent calls and assert the module correctly limits in-flight requests, and that it recovers concurrency headroom appropriately after load subsides.Acceptance Criteria
pnpm test:runpasses with no flaky failures across 5 consecutive local runsLikely Affected Files/Directories
src/access/adaptiveConcurrency.ts