Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup log filter #11719

Merged
merged 1 commit into from
Jul 2, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import static org.assertj.core.api.Assertions.assertThat;

import io.opentelemetry.api.OpenTelemetry;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -19,6 +21,11 @@
@ExtendWith(OutputCaptureExtension.class)
public abstract class AbstractSpringStarterSmokeTest {

private static final List<String> IGNORED_WARNINGS =
Arrays.asList(
"Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider",
"The architecture 'amd64' for image");

@Autowired protected OpenTelemetry openTelemetry;

protected SpringSmokeTestRunner testing;
Expand Down Expand Up @@ -47,11 +54,10 @@ void checkSpringLogs(CapturedOutput output) {
// only look for WARN and ERROR log level, e.g. [Test worker] WARN
.satisfies(
s -> {
if (!s.toString()
.contains(
"Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider")
&& !s.toString().contains("The architecture 'amd64' for image")) {
assertThat(s).doesNotContain("] WARN").doesNotContain("] ERROR");
for (String line : s.toString().split("\n")) {
if (IGNORED_WARNINGS.stream().noneMatch(line::contains)) {
assertThat(line).doesNotContain("] WARN").doesNotContain("] ERROR");
}
}
});
}
Expand Down
Loading