GitHub
03/28/2025, 11:33 AMThe active test run was aborted. Reason: Test host process crashed
Test Run Aborted.
_VSTestConsole:
MSB4181: The "VSTestTask" task returned false but did not log an error.
1>Done Building Project "/app/tests/MyProject.Pacts/MyProject.Pacts.csproj" (VSTest target(s)) -- FAILED.
Build FAILED.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:03.52
Process exited with code 1
Test ignored: MyProject.ProviderTests.VerifyPacts, ignore reason: Interrupted by build execution timeout
Consumer tests work absolutely fine, it's only provider tests that crash.
Steps To Reproduce
Unsure currently - it was working fine before the upgrade
Additional context
The diff between 5.0.0 and 5.0.1 only really has an FFI upgrade in it, so I'm assuming the issue is there and that it's crashing the provider tests.
pact-foundation/pact-netErich Zimmerman
04/01/2025, 9:35 PMJordi March
04/09/2025, 12:52 PMGitHub
04/22/2025, 1:46 PMGitHub
04/24/2025, 7:28 AMMessagingProvider
and is configured to download from a pact broker:
using var verifier = new PactVerifier(config);
verifier.MessagingProvider("personal-details-api", CreateJsonSettings())
.WithProviderMessages(scenarios =>
{
scenarios.Add("An event is created", _event);
})
.WithPactBrokerSource(_pactBrokerUri)
.Verify();
}
I was hoping/assuming that this would only download the messaging pact from pact broker but it is also downloading the request/response pact too so fails as it only expects messages.
The "provider" name in Pact Broker is the same (which makes sense to me as the provider is the same), but do I have to have unique provider names?
pact-foundation/pact-netGitHub
05/06/2025, 5:08 PMhttpVerifier.WithHttpEndpoint(providerUri)
Then I'm calling Verify()
method
Log Output
I'm getting 401
Could you guys help me to understand what I'm missing ?
pact-foundation/pact-netGitHub
05/27/2025, 5:21 PMDimitris Dranidis
06/05/2025, 3:29 PM.WithMessages(scenarios => {
scenarios.Add(
"scenario description",
builder => SetupDescriptionA(builder));
}, _serializerOptions) ...
and the state handler "prepare data" in the middleware. I would expect the state handler to execute FIRST to prepare the data for the content of the message, and THEN the description handler to execute SECOND so that it uses a messageProducer function to generate the message based on the prepared data, But it is the opposite!
This forces us to abandon providerStates and only use descriptions for both setting the environment and producing the message.
In case, I misunderstand something please let me know.
Thank you in advance!GitHub
06/06/2025, 3:36 PM<https://github.com/dranidis/pact-dotnet-message-provider>
Expected behavior
We have a provider test of an AMQP interaction in Pact. The interaction has a "description" and "providerStates". We added in the test:
.WithMessages(scenarios => {
scenarios.Add(
"scenario description",
builder => SetupDescriptionA(builder));
}, _serializerOptions) ...
and the state handler "prepare data" in the middleware.
I would expect the state handler to execute FIRST to prepare the data for the content of the message, and THEN the description handler to execute SECOND so that it uses a messageProducer function to generate the message based on the prepared data, But it is the opposite!
This forces us to abandon providerStates and only use descriptions for both setting the environment and producing the message.
In case, I misunderstand something please let me know.
pact-foundation/pact-netGitHub
06/13/2025, 5:10 PMGitHub
06/14/2025, 1:33 PMGitHub
06/14/2025, 1:34 PM@dependabot rebase
.
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
• @dependabot rebase
will rebase this PR
• @dependabot recreate
will recreate this PR, overwriting any edits that have been made to it
• @dependabot merge
will merge this PR after your CI passes on it
• @dependabot squash and merge
will squash and merge this PR after your CI passes on it
• @dependabot cancel merge
will cancel a previously requested merge and block automerging
• @dependabot reopen
will reopen this PR if it is closed
• @dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
• @dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency
• @dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
• @dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
• @dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the Security Alerts page.
pact-foundation/pact-netRyan Child
06/18/2025, 3:00 PMZachary Lysobey
06/20/2025, 12:56 PMGitHub
06/20/2025, 2:19 PM<http://localhost:41952/pact-messages/>
, it receive a 404 response without going through the HandleRequest
method of MessageProvider
.
If I modify the prefix uri with 127.0.0.1
, then it works in all cases.
What is important is that the Uri added to the HttpListener must be 127.0.0.1
. Then, the returned uri can be the ip
or localhost
it works in both cases.
I know it is connecting to the listener somehow because if I comment out the start of the HttpListener, then it cannot connect.
There is definetely something going in the middle with localhost
but I can't figure it out.
Steps To Reproduce
I didn't succeed yet identifying what's going on.
Expected behavior
The listener should be able to receive pact_verifier request
Log Output
2025-06-20T13:58:12.662599Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: reqwest::connect: starting new connection: <http://127.0.0.1:49152/>
2025-06-20T13:58:12.662613Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: hyper_util::client::legacy::connect::http: connecting to 127.0.0.1:49152
2025-06-20T13:58:12.662888Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: hyper_util::client::legacy::connect::http: connected to 127.0.0.1:49152
2025-06-20T13:58:12.691760Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: hyper_util::client::legacy::pool: pooling idle connection for ("http", 127.0.0.1:49152)
2025-06-20T13:58:12.691815Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: pact_verifier::provider_client: Received native response: Response { url: "<http://127.0.0.1:49152/pact-messages>", status: 404, headers: {"content-type": "text/html", "server": "Microsoft-NetCore/2.0", "date": "Fri, 20 Jun 2025 13:58:12 GMT", "content-length": "30"} }
2025-06-20T13:58:12.691945Z INFO ThreadId(01) verify_interaction{interaction="A valid message"}: pact_verifier::provider_client: Received response: HTTP Response ( status: 404, headers: Some({"content-type": ["text/html"], "server": ["Microsoft-NetCore/2.0"], "date": ["Fri, 20 Jun 2025 13:58:12 GMT"], "content-length": ["30"]}), body: Present(30 bytes, text/html) )
2025-06-20T13:58:12.691967Z DEBUG ThreadId(01) verify_interaction{interaction="A valid message"}: pact_verifier::provider_client: body:
<h1>Not Found (Not Found)</h1>
pact-foundation/pact-netTiago Bernardo
06/25/2025, 3:26 PMJegadeesan Ponnusamy
06/26/2025, 3:29 PMdiscriminator
, but the Pact.NET library doesn't seems to support this. Could you please let us know, how we should proceed further to test this? Thank you. https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas/keyword-support#general-adviceLindsay Duncan
07/03/2025, 2:25 PMAaron Small
07/07/2025, 5:09 AMusing var pactVerifier = new PactVerifier("MyService", config);
pactVerifier
.WithHttpEndpoint(new Uri("<http://localhost:5001>"))
.WithFileSource(new FileInfo(pactPath))
.Verify();
Thanks!GitHub
07/10/2025, 9:54 PM2025-07-10T21:23:11.928119Z ERROR ThreadId(01) pact_verifier::pact_broker: Failed to push branch refs/head/test for provider version test
2025-07-10T21:23:11.928223Z ERROR ThreadId(01) pact_verifier: Publishing of verification results failed with an error: Link/Resource was not found - Request to pact broker path '/pacticipants/myprovider/branches/refs%2Fhead%2Ftest/versions/test' failed: 404 Not Found. URL: '<https://pactbroker.com/>'
Steps To Reproduce
options.PublishResults(brokerConfig.ProviderVersion, publishOptions =>
{
publishOptions
.BuildUri("<http://test>")
.ProviderBranch("/refs/head/test");
});
Expected behavior
The provider verification result should be published to a branch with a slash. This is a supported value with the pact cli to publish consumer contract.
Log Output
See above
Additional context
Replacing /
with -
make it works.
pact-foundation/pact-netDavid Mason
07/11/2025, 2:22 PMPactVerifier.WithMessages
doesn't exist.
Using pact-net 5.0.1
Is this a known issue? What can we do to verify a pact containing interactions with type Asynchronous/Message (pact specification v4)Bas Dijkstra
07/15/2025, 10:31 AMthis.verifier!
.WithHttpEndpoint(PactServiceUri)
.WithPactBrokerSource(new Uri(Environment.GetEnvironmentVariable("PACT_BROKER_BASE_URL")!), options =>
{
options
.TokenAuthentication(Environment.GetEnvironmentVariable("PACT_BROKER_TOKEN"))
.PublishResults(Environment.GetEnvironmentVariable("ADDRESS_PROVIDER_VERSION") ?? "1.0.0")
.ProviderBranch("main");
})
.WithProviderStateUrl(new Uri($"{PactServiceUri}provider-states"))
.Verify();
However, it doesn't seem to work, the ProviderBranch()
call seems to be ignored. I'm using Pact .Net 5.0.0.Dominick Campbell
07/18/2025, 8:20 PMGitHub
08/01/2025, 6:46 PMPactHandle
with pactffi_new_pact
, it need to be freed with pactffi_free_pact_handle
.
I implement Disposable interface but not sure how to handle unmanaged resource with finalizer.
BTW, I see that pactffi has a dedicated method for message interactions (pactffi_new_message_pact
, pactffi_free_message_pact_handle
) and use them. It doesn't change the way the consumer test generate its pact file.
pact-foundation/pact-netboden winkel
08/21/2025, 2:01 PMGitHub
08/25/2025, 10:31 AMGitHub
09/04/2025, 9:57 PMPactNet.Interop
package as @adamrodger suggested in Issue #492 . This was not a breaking change since all the classes in this namespace were internal, PactNet
now references this new package and none of the pre-existing interface methods have changed. Extracting this package made it possible to create bare-bones Grpc plugin tests and is effectively a very "raw" way of using any plugin. Perhaps a next step would be to wrap the bare-bones methods in a more fluent "raw" interface in a plugin package similar to implementations in other languages as @Matt (pactflow.io / pact-js / pact-go) suggested.
In any case, as a next step from here I was hoping to start working on an implementation of a PactNet.Extensions.Grpc
package that follows the conventions established in the existing http and message interactions.
An alternative approach here would be to just add <InternalsVisibleTo Include="PactNet.Extensions.Grpc" />
to the PactNet.csproj file but this allows integration of other plugins in repos outside this one so it depends on whether you want to explicitly allow that or not.
pact-foundation/pact-netMartin
09/05/2025, 11:47 AMtext/plain
instead of JSON.
What I’ve noticed:
• On the consumer side, the DSL only exposes helpers like WithJsonContent(...)
which always serialize the messages to JSON. I don’t see a way to say "the body is raw text and the contentType is `text/plain`".
• On the provider side, when using .WithMessages(...).WithContent(...)
, any string
gets serialized as JSON and the content type ends up application/json
. I don’t see an overload that doesn't take the JsonSerializationOptions.
So essentially: I don’t see a way in PactNet to produce or verify a message pact where the body is plain text and the content type is text/plain
.
👉 My questions:
• Is this a known limitation in PactNet?
• Or is there some sample code / workaround that shows how to handle non-JSON content types (like text/plain
) in message pacts on .NET?
We’re using PactNet 5.0.1 (PactNet
+ PactNet.Abstractions
).
Thanks in advance!GitHub
09/05/2025, 2:40 PMgit status
you will see that PactNet.sln all line-endings have immediately changed. Potential solution is described in the accepted answer of the above referenced SO post.
Appears that the root cause may be that line endings were not renormalized (git add --renormalize .
) when the .gitattributes file was added.
pact-foundation/pact-netPaul
09/12/2025, 5:17 AM