Skip to content

[Bug]: chaos document bug #2483

Closed
Closed

Description

@caigen

Describe the bug

The sample in https://www.pollydocs.org/chaos/index.html is not clear.

When 2% is used by AddChaosLatency & AddChaosFault & AddChaosOutcome together, the detail behavior needs to be clarified.

// 2% of invocations will be injected with chaos
const double InjectionRate = 0.02;

builder
    .AddChaosLatency(InjectionRate, TimeSpan.FromMinutes(1)) // Inject a chaos latency to executions
    .AddChaosFault(InjectionRate, () => new InvalidOperationException("Injected by chaos strategy!")) // Inject a chaos fault to executions
    .AddChaosOutcome(InjectionRate, () => new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError)) // Inject a chaos outcome to executions
    .AddChaosBehavior(0.001, cancellationToken => RestartRedisAsync(cancellationToken)); // Inject a chaos behavior to executions

Expected behavior

No response

Actual behavior

No response

Steps to reproduce

No response

Exception(s) (if any)

No response

Polly version

No response

.NET Version

No response

Anything else?

No response

Activity

  1. caigen commented on Feb 7, 2025

    @caigen
    ContributorAuthor

    Fixed in #2482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions