Skip to content

Commit 42df420

Browse files
authored
fix: Add HTTP wait strategy to prevent race-condition in TarOutputMemoryStreamTest (#1297)
1 parent 228b823 commit 42df420

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Testcontainers.WebDriver/WebDriverBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ protected override WebDriverBuilder Init()
100100
.WithNetworkAliases(WebDriverNetworkAlias)
101101
.WithPortBinding(WebDriverPort, true)
102102
.WithPortBinding(VncServerPort, true)
103-
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request
104-
=> request.ForPath("/wd/hub/status").ForPort(WebDriverPort).ForResponseMessageMatching(IsGridReadyAsync)));
103+
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
104+
request.ForPath("/wd/hub/status").ForPort(WebDriverPort).ForResponseMessageMatching(IsGridReadyAsync)));
105105
}
106106

107107
/// <inheritdoc />

tests/Testcontainers.Platform.Linux.Tests/TarOutputMemoryStreamTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ public sealed class HttpFixture : IAsyncLifetime
176176
.WithEntrypoint("/bin/sh", "-c")
177177
.WithCommand($"while true; do echo \"HTTP/1.1 200 OK\r\n\r\n\" | nc -l -p {HttpPort}; done")
178178
.WithPortBinding(HttpPort, true)
179+
.WithWaitStrategy(Wait.ForUnixContainer().UntilHttpRequestIsSucceeded(request =>
180+
request.ForPath("/")))
179181
.Build();
180182

181183
public string BaseAddress

0 commit comments

Comments
 (0)