Skip to content

Commit

Permalink
Fix logback appender test (#12027)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit authored Aug 15, 2024
1 parent 06f4f52 commit a69bf33
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ void logWithExtras() {

executeAfterLogsExecution();

Instant now = Instant.now();
List<LogRecordData> logDataList = logRecordExporter.getFinishedLogRecordItems();
assertThat(logDataList).hasSize(1);
LogRecordData logData = logDataList.get(0);
Expand All @@ -121,7 +122,7 @@ void logWithExtras() {
assertThat(logData.getBody().asString()).isEqualTo("log message 1");
assertThat(logData.getTimestampEpochNanos())
.isGreaterThanOrEqualTo(TimeUnit.MILLISECONDS.toNanos(start.toEpochMilli()))
.isLessThanOrEqualTo(TimeUnit.MILLISECONDS.toNanos(Instant.now().toEpochMilli()));
.isLessThanOrEqualTo(TimeUnit.SECONDS.toNanos(now.getEpochSecond()) + now.getNano());
assertThat(logData.getSeverity()).isEqualTo(Severity.INFO);
assertThat(logData.getSeverityText()).isEqualTo("INFO");
assertThat(logData.getAttributes().size())
Expand Down

0 comments on commit a69bf33

Please sign in to comment.