You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: HttpWaitStrategy removes line breaks in http response body before responsePredicate invocation #7326
for some reason, the HttpWaitStrategy reads the response line by line, but does not save the line break characters. In some cases it is really bad, for example, parsing the prometheus metric of springboot application becomes a nightmare.
from org.testcontainers.containers.wait.strategy.HttpWaitStrategy
changed the title [-][Bug]: HttpWaitStrategry removes new lines in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes new lines in http response before responsePredicate invocation[/+]on Jul 24, 2023
changed the title [-][Bug]: HttpWaitStrategy removes new lines in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes line breaks in http response before responsePredicate invocation[/+]on Jul 24, 2023
changed the title [-][Bug]: HttpWaitStrategy removes line breaks in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes line breaks in http response body before responsePredicate invocation[/+]on Jul 24, 2023
Hello team, I've opened a PR #11937 to resolve this bug. It replaces the manual stream reading loop with IOUtils.toString() to preserve line breaks and response formatting.
Any feedback on the PR would be greatly appreciated. Thank you!
Activity
[-][Bug]: HttpWaitStrategry removes new lines in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes new lines in http response before responsePredicate invocation[/+][-][Bug]: HttpWaitStrategy removes new lines in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes line breaks in http response before responsePredicate invocation[/+][-][Bug]: HttpWaitStrategy removes line breaks in http response before responsePredicate invocation[/-][+][Bug]: HttpWaitStrategy removes line breaks in http response body before responsePredicate invocation[/+]eddumelendez commentedon Jul 24, 2023
Hi, I haven't had issues with prometheus and the wait strategy. See
https://github.com/eddumelendez/testcontainers-samples/blob/c775a75f1f935ed4faa3559ce82e520bb22efa43/spring-boot-prometheus/src/test/java/com/example/springbootprometheus/SpringBootPrometheusApplicationTests.java#L33-L35
antonovdmitriy commentedon Jul 24, 2023
@eddumelendez thanks but there is no
HttpWaitStrategywithPredicatein your example. OnlyWait.forLogMessageis using.ivankrn commentedon Jul 19, 2026
Hello team, I've opened a PR #11937 to resolve this bug. It replaces the manual stream reading loop with
IOUtils.toString()to preserve line breaks and response formatting.Any feedback on the PR would be greatly appreciated. Thank you!