Skip to content

Commit da07184

Browse files
authored
chore: Bump Ryuk (#1537)
1 parent 410d2c8 commit da07184

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

src/Testcontainers/Clients/DockerApiClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ await RuntimeInitialized.WaitAsync(ct)
119119
}
120120
Logger.LogInformation("{RuntimeInfo}", runtimeInfo);
121121
}
122-
catch(Exception e)
122+
catch (Exception e)
123123
{
124124
Logger.LogError(e, "Failed to retrieve Docker container runtime information");
125125
}

src/Testcontainers/Clients/TestcontainersClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ public async Task<string> RunAsync(IContainerConfiguration configuration, Cancel
311311
{
312312
ImageInspectResponse cachedImage;
313313

314-
if (TestcontainersSettings.ResourceReaperEnabled && ResourceReaper.DefaultSessionId.Equals(configuration.SessionId))
314+
if (TestcontainersSettings.ResourceReaperEnabled
315+
&& ResourceReaper.IsUnavailable
316+
&& ResourceReaper.DefaultSessionId.Equals(configuration.SessionId))
315317
{
316318
var isWindowsEngineEnabled = await System.GetIsWindowsEngineEnabled(ct)
317319
.ConfigureAwait(false);

src/Testcontainers/Containers/ResourceReaper.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public sealed class ResourceReaper : IAsyncDisposable
3333
/// </summary>
3434
private const int RetryTimeoutInSeconds = 2;
3535

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

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

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

93+
/// <summary>
94+
/// Gets a value indicating whether the default <see cref="ResourceReaper" /> instance is running and available.
95+
/// </summary>
96+
[PublicAPI]
97+
public static bool IsUnavailable
98+
=> _defaultInstance == null || _defaultInstance._disposed;
99+
93100
/// <summary>
94101
/// Gets the <see cref="ResourceReaper" /> session id.
95102
/// </summary>

tests/Testcontainers.Commons/CommonImages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace DotNet.Testcontainers.Commons;
33
[PublicAPI]
44
public static class CommonImages
55
{
6-
public static readonly IImage Ryuk = new DockerImage("testcontainers/ryuk:0.12.0");
6+
public static readonly IImage Ryuk = new DockerImage("testcontainers/ryuk:0.14.0");
77

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

0 commit comments

Comments
 (0)