Skip to content

Commit

Permalink
[AMQ-9258] Add NPE guards to kahadb test that intermittently fails on…
Browse files Browse the repository at this point in the history
… slower CI servers (apache#1006)
  • Loading branch information
mattrpav authored and NikitaShupletsov committed Sep 1, 2023
1 parent 14e339c commit df07079
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,13 @@ public void testRecoveryAfterCorruptionMetadataLocation() throws Exception {
final var appender = new AbstractAppender("testAppender", new AbstractFilter() {}, new MessageLayout(), false, new Property[0]) {
@Override
public void append(LogEvent event) {
if (event.getLevel() == Level.WARN
if (event != null
&& event.getLevel() == Level.WARN
&& event.getMessage() != null
&& event.getMessage().getFormattedMessage() != null
&& event.getMessage().getFormattedMessage().contains("Cannot recover message audit")
&& event.getThrown() != null
&& event.getThrown().getLocalizedMessage() != null
&& event.getThrown().getLocalizedMessage().contains("Invalid location size")) {
trappedExpectedLogMessage.set(true);
}
Expand Down

0 comments on commit df07079

Please sign in to comment.