mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Request matching WithProbability strange behaviour #611
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mihailtrifonovio on GitHub (Jun 20, 2024).
Originally assigned to: @StefH on GitHub.
Based on article for "Chaos Engineering with Fault Injections" I've added following code:
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 commented on GitHub (Oct 16, 2024):
@mihailtrifonovio
Can you provide a example project?
@StefH commented on GitHub (Dec 7, 2024):
@mihailtrifonovio
Can you provide a example project?
@StefH commented on GitHub (Jan 11, 2025):
@mihailtrifonovio
Can you provide a example project?
@TheRubble commented on GitHub (Apr 16, 2025):
Did this ever get sorted? I'm using the aspire integration (1.7.4 & 1.8.0-prview-01).
It's just returning the failure (500) response.
@StefH commented on GitHub (Oct 13, 2025):
@TheRubble
Thanks for reporting, this is indeed a bug. The Probability logic was wrong.
This PR should fix it https://github.com/wiremock/WireMock.Net/pull/1367
However when using more WithProbability for the same mapping, the logic is still not 100% ok.
So if you have
The second one will only be chosen about 5% of the time, not 10%...
I'll fix this maybe later.