Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request matching WithProbability strange behaviour #1126

Open
mihailtrifonovio opened this issue Jun 20, 2024 · 2 comments
Open

Request matching WithProbability strange behaviour #1126

mihailtrifonovio opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels

Comments

@mihailtrifonovio
Copy link

mihailtrifonovio commented Jun 20, 2024

Based on article for "Chaos Engineering with Fault Injections" I've added following code:

var server = StandAloneApp.Start(new WireMockServerSettings {  Port = 8888 } );

        server
          .Given(Request.Create().WithPath("/test").UsingGet())
          .WithProbability(0.5)
          .RespondWith(Response.Create()
              .WithStatusCode(200)
              .WithBody(@"Success")
            );

        server
          .Given(Request.Create().WithPath("/test").UsingGet())
          .RespondWith(Response.Create()
              .WithStatusCode(500)
              .WithBody(@"Internal Server error")
          );

My expectation is that around 50% of the time there will be faults. However it is 100% of the time. If second matching is removed then there is some distribution between 200 and 404(no matching found), but is not 1:1 and more like 5:1 in favor of 404.

Is there something I'm missing?

@StefH StefH self-assigned this Jul 2, 2024
@StefH
Copy link
Collaborator

StefH commented Oct 16, 2024

@mihailtrifonovio
Can you provide a example project?

@StefH
Copy link
Collaborator

StefH commented Dec 7, 2024

@mihailtrifonovio
Can you provide a example project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants