Skip to content

Random error plugins: rate 99 behaves like 100 and all rates are slightly off #1926

Closed

Description

@waldekmastykarz

Description

GenericRandomErrorPlugin and GraphRandomErrorPlugin don't apply the configured failure rate exactly. Both use:

_random.Next(1, 100) <= Configuration.Rate

Random.Next(1, 100) returns values from 1 to 99 (upper bound is exclusive), so:

  • rate: 99 behaves like rate: 100 (every request fails)
  • every other rate is slightly higher than configured (for example, rate: 50 fails ~50.5% of requests, rate: 1 ~1.01%)

Code:

Expected behavior

rate: N fails exactly N% of requests on average, for example by using _random.Next(0, 100) < Configuration.Rate.

Steps to reproduce

  1. Configure GenericRandomErrorPlugin with "rate": 99
  2. Send many requests through the proxy
  3. Observe that every request fails

Activity

  1. added a commit that references this issue on Oct 20, 2026
    98e8819
  2. added a commit that references this issue on Oct 21, 2026
    6b2ba70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions