mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Merge branch 'master' into version-2.x
This commit is contained in:
@@ -15,7 +15,7 @@ using Xunit.Abstractions;
|
||||
|
||||
namespace WireMock.Net.Tests.Testcontainers;
|
||||
|
||||
public partial class TestcontainersTests(ITestOutputHelper testOutputHelper)
|
||||
public class TestcontainersTests(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
[Fact]
|
||||
public async Task WireMockContainer_Build_And_StartAsync_and_StopAsync()
|
||||
|
||||
@@ -15,10 +15,12 @@ using WireMock.Constants;
|
||||
using WireMock.Net.Testcontainers;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace WireMock.Net.Tests.Testcontainers;
|
||||
|
||||
public partial class TestcontainersTests
|
||||
[Collection("Grpc")]
|
||||
public class TestcontainersTestsGrpc(ITestOutputHelper testOutputHelper)
|
||||
{
|
||||
[Fact]
|
||||
public async Task WireMockContainer_Build_Grpc_TestPortsAndUrls1()
|
||||
@@ -169,6 +171,28 @@ public partial class TestcontainersTests
|
||||
await StopAsync(wireMockContainer);
|
||||
}
|
||||
|
||||
private async Task StopAsync(WireMockContainer wireMockContainer)
|
||||
{
|
||||
try
|
||||
{
|
||||
await wireMockContainer.StopAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// Sometimes we get this exception, so for now ignore it.
|
||||
/*
|
||||
Failed WireMock.Net.Tests.Testcontainers.TestcontainersTests.WireMockContainer_Build_WithImageAsText_And_StartAsync_and_StopAsync [9 s]
|
||||
Error Message:
|
||||
System.NullReferenceException : Object reference not set to an instance of an object.
|
||||
Stack Trace:
|
||||
at DotNet.Testcontainers.Containers.DockerContainer.UnsafeStopAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 567
|
||||
at DotNet.Testcontainers.Containers.DockerContainer.StopAsync(CancellationToken ct) in /_/src/Testcontainers/Containers/DockerContainer.cs:line 319
|
||||
*/
|
||||
|
||||
testOutputHelper.WriteLine($"Exception during StopAsync: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<WireMockContainer> Given_WireMockContainerIsStartedForHttpAndGrpcAsync()
|
||||
{
|
||||
var port = PortUtils.FindFreeTcpPort();
|
||||
Reference in New Issue
Block a user