Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Testcontainers/Clients/DockerApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ await RuntimeInitialized.WaitAsync(ct)
}
Logger.LogInformation("{RuntimeInfo}", runtimeInfo);
}
catch(Exception e)
catch (Exception e)
{
Logger.LogError(e, "Failed to retrieve Docker container runtime information");
}
Expand Down
4 changes: 3 additions & 1 deletion src/Testcontainers/Clients/TestcontainersClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ public async Task<string> RunAsync(IContainerConfiguration configuration, Cancel
{
ImageInspectResponse cachedImage;

if (TestcontainersSettings.ResourceReaperEnabled && ResourceReaper.DefaultSessionId.Equals(configuration.SessionId))
if (TestcontainersSettings.ResourceReaperEnabled
&& ResourceReaper.IsUnavailable
&& ResourceReaper.DefaultSessionId.Equals(configuration.SessionId))
{
var isWindowsEngineEnabled = await System.GetIsWindowsEngineEnabled(ct)
.ConfigureAwait(false);
Expand Down
9 changes: 8 additions & 1 deletion src/Testcontainers/Containers/ResourceReaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public sealed class ResourceReaper : IAsyncDisposable
/// </summary>
private const int RetryTimeoutInSeconds = 2;

private static readonly IImage RyukImage = new DockerImage("testcontainers/ryuk:0.12.0");
private static readonly IImage RyukImage = new DockerImage("testcontainers/ryuk:0.14.0");

private static readonly SemaphoreSlim DefaultLock = new SemaphoreSlim(1, 1);

Expand Down Expand Up @@ -90,6 +90,13 @@ private ResourceReaper(Guid sessionId, IDockerEndpointAuthenticationConfiguratio
public static Guid DefaultSessionId { get; }
= Guid.NewGuid();

/// <summary>
/// Gets a value indicating whether the default <see cref="ResourceReaper" /> instance is running and available.
/// </summary>
[PublicAPI]
public static bool IsUnavailable
=> _defaultInstance == null || _defaultInstance._disposed;

/// <summary>
/// Gets the <see cref="ResourceReaper" /> session id.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion tests/Testcontainers.Commons/CommonImages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace DotNet.Testcontainers.Commons;
[PublicAPI]
public static class CommonImages
{
public static readonly IImage Ryuk = new DockerImage("testcontainers/ryuk:0.12.0");
public static readonly IImage Ryuk = new DockerImage("testcontainers/ryuk:0.14.0");

public static readonly IImage HelloWorld = new DockerImage("testcontainers/helloworld:1.2.0");

Expand Down