mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 22:30:41 +01:00
An exception occurs when adding multiple proto definitions in the TestContainer. #737
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 @Allen0117 on GitHub (Dec 22, 2025).
Originally assigned to: @StefH on GitHub.
Describe the bug
I found that when only one proto definition is added, my test case passes successfully; however, once more than one is added, the following error occurs.
When reporting the issue, I found the behavior to be quite unstable—it sometimes passes and sometimes fails.
Exception Detail
Test code
@StefH commented on GitHub (Dec 22, 2025):
@Allen0117
Can you please provide the logging?
And specifically anything with "ProtoDefinition".
@Allen0117 commented on GitHub (Dec 23, 2025):
Hi @StefH
Continaer logging
ProtoDefinition Structure

ProtoDefinition
transfer.proto
gifting.proto
Req.proto
Response.proto
customDatetime.proto
customDecimal.proto
@StefH commented on GitHub (Dec 23, 2025):
I think the issue is that TestContainers indicates that the container is started, and I will send those post-requests to WireMock.Net, but I think that WireMock.Net is not fully started / healthy yet.
So I need to add something like I did do for Aspire:
https://github.com/wiremock/WireMock.Net/blob/master/src/WireMock.Net.Aspire/WireMockHealthCheck.cs
@Allen0117 commented on GitHub (Dec 23, 2025):
We did observe flaky test results—sometimes passing and sometimes failing. Therefore, I’d like to confirm whether we should use an existing HealthAsync method or implement our own health-check mechanism.
@StefH commented on GitHub (Dec 23, 2025):
@Allen0117
I'm try to add the health check (https://github.com/wiremock/WireMock.Net/pull/1405)...
But you can also build your own Health check.
@Allen0117 commented on GitHub (Dec 24, 2025):
I’d like to share the WaitStrategy approach I implemented with you. After adding it, the error no longer occurs, no matter how many times I try.
@StefH commented on GitHub (Dec 24, 2025):
Note that if you defined basic-auth on wiremock server, you need to update this.
@Allen0117 commented on GitHub (Dec 24, 2025):
"you need to update this." => Does this mean that I need to update this conversation thread (the issue discussion)?
@StefH commented on GitHub (Dec 24, 2025):
No I mean that you need WithBasicAuthentication if you have username + password set in the server.
Note that I've added this logic in the code, so you probably don't need this to build yourself when a new version is released.
@StefH commented on GitHub (Dec 25, 2025):
https://github.com/wiremock/WireMock.Net/pull/1408