Skip to content

Commit fc47836

Browse files
authored
fix: Retrieve logs since CreatedTime for UntilMessageIsLogged wait strategy (#1384)
1 parent 79ad7f9 commit fc47836

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Testcontainers/Configurations/WaitStrategies/UntilMessageIsLogged.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public UntilMessageIsLogged(Regex pattern)
2121

2222
public async Task<bool> UntilAsync(IContainer container)
2323
{
24-
var (stdout, stderr) = await container.GetLogsAsync(since: container.StoppedTime, timestampsEnabled: false)
24+
var maxTime = container.StoppedTime > container.CreatedTime ? container.StoppedTime : container.CreatedTime;
25+
var (stdout, stderr) = await container.GetLogsAsync(since: maxTime, timestampsEnabled: false)
2526
.ConfigureAwait(false);
2627

2728
return _pattern.IsMatch(stdout) || _pattern.IsMatch(stderr);

0 commit comments

Comments
 (0)