Skip to content

Commit

Permalink
Ignore SLFJ4 warnings in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario committed Apr 23, 2021
1 parent aa35af7 commit 5bf730e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
21 changes: 14 additions & 7 deletions testsuite/src/it/java/io/quarkus/ts/startstop/utils/Logs.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,20 @@ public static void checkLog(String testClass, String testMethod, Apps app, MvnCm
}
}

// Quarkus is not being gratefully shutdown in Windows when running in Dev mode.
// Reported by https://github.com/quarkusio/quarkus/issues/14647.
if (Commands.isThisWindows && isDevModeError(offendingLines)) {
for (Pattern windowsDevModeErrorToIgnore : WhitelistLogLines.WINDOWS_DEV_MODE_ERRORS.errs) {
offendingLines.removeIf(line -> windowsDevModeErrorToIgnore.matcher(line).matches());
}
}
if (Commands.isThisWindows) {

List<Pattern> ignoredErrs = new ArrayList<>(Arrays.asList(WhitelistLogLines.WINDOWS_ERRORS.errs));

if (isDevModeError(offendingLines)) {
// Quarkus is not being gratefully shutdown in Windows when running in Dev mode.
// Reported by https://github.com/quarkusio/quarkus/issues/14647.
ignoredErrs.addAll(Arrays.asList(WhitelistLogLines.WINDOWS_DEV_MODE_ERRORS.errs));
}

for (Pattern windowsDevModeErrorToIgnore : ignoredErrs) {
offendingLines.removeIf(line -> windowsDevModeErrorToIgnore.matcher(line).matches());
}
}

assertTrue(offendingLines.isEmpty(),
cmd.name() + " log should not contain error or warning lines that are not whitelisted. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public enum WhitelistLogLines {
// Result of DevServices support https://github.com/quarkusio/quarkus/pull/14960
Pattern.compile(".*Unable to determine a database type for default datasource.*"),
}),
WINDOWS_ERRORS(new Pattern[] {
// When running on Windows, some warning SLF4J traces are randomly printed
Pattern.compile(".*SLF4J: .*")
}),
WINDOWS_DEV_MODE_ERRORS(new Pattern[]{
Pattern.compile(".*Re-run Maven using the -X switch to enable full debug logging.*"),
Pattern.compile(".*For more information about the errors and possible solutions, please read the following articles.*"),
Expand Down

0 comments on commit 5bf730e

Please sign in to comment.