Skip to content

Commit

Permalink
Merge pull request #19947 from stuartwdouglas/fix-log-assert
Browse files Browse the repository at this point in the history
Fix log assertions
  • Loading branch information
stuartwdouglas authored Sep 7, 2021
2 parents 154475c + 31138b0 commit d62b296
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,9 @@ private Throwable unwrapException(Throwable cause) {
public void afterAll(ExtensionContext extensionContext) throws Exception {
actualTestClass = null;
actualTestInstance = null;
List<LogRecord> records = null;
if (assertLogRecords != null) {
assertLogRecords.accept(inMemoryLogHandler.records);
records = new ArrayList<>(inMemoryLogHandler.records);
}
rootLogger.setHandlers(originalHandlers);
inMemoryLogHandler.clearRecords();
Expand Down Expand Up @@ -606,9 +607,12 @@ public void afterAll(ExtensionContext extensionContext) throws Exception {
if (afterAllCustomizer != null) {
afterAllCustomizer.run();
}
ClearCache.clearAnnotationCache();
GroovyCacheCleaner.clearGroovyCache();
}
if (records != null) {
assertLogRecords.accept(records);
}
ClearCache.clearAnnotationCache();
GroovyCacheCleaner.clearGroovyCache();
}

@Override
Expand Down

0 comments on commit d62b296

Please sign in to comment.