Skip to content

Commit

Permalink
Updating logs tests ConsumeLogs calls
Browse files Browse the repository at this point in the history
  • Loading branch information
LikeTheSalad committed Oct 18, 2023
1 parent 5d37ae7 commit e7b86bb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions input/otlp/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,9 @@ func TestConsumerConsumeOTelLogsWithTimestamp(t *testing.T) {
Processor: processor,
Semaphore: semaphore.NewWeighted(100),
})
assert.NoError(t, consumer.ConsumeLogs(context.Background(), logs))
result, err := consumer.ConsumeLogs(context.Background(), logs)
assert.NoError(t, err)
assert.Equal(t, otlp.ConsumeLogsResult{}, result)

assert.Len(t, processed, 1)
assert.Equal(t, int(timestamp.AsTime().UnixNano()), int(processed[0].Timestamp))
Expand Down Expand Up @@ -518,7 +520,9 @@ func TestConsumerConsumeOTelLogsWithoutTimestamp(t *testing.T) {
Processor: processor,
Semaphore: semaphore.NewWeighted(100),
})
assert.NoError(t, consumer.ConsumeLogs(context.Background(), logs))
result, err := consumer.ConsumeLogs(context.Background(), logs)
assert.NoError(t, err)
assert.Equal(t, otlp.ConsumeLogsResult{}, result)

assert.Len(t, processed, 1)
assert.Equal(t, int(timestamp.AsTime().UnixNano()), int(processed[0].Timestamp))
Expand Down Expand Up @@ -550,7 +554,9 @@ func TestConsumerConsumeOTelLogsWithObservedTimestampWithoutTimestamp(t *testing
Processor: processor,
Semaphore: semaphore.NewWeighted(100),
})
assert.NoError(t, consumer.ConsumeLogs(context.Background(), logs))
result, err := consumer.ConsumeLogs(context.Background(), logs)
assert.NoError(t, err)
assert.Equal(t, otlp.ConsumeLogsResult{}, result)

assert.Len(t, processed, 1)
assert.Equal(t, int(observedTimestamp.AsTime().UnixNano()), int(processed[0].Timestamp))
Expand Down

0 comments on commit e7b86bb

Please sign in to comment.