Skip to content

Commit

Permalink
Merge branch 'main' into logs-configuration-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylareopelle authored Nov 16, 2024
2 parents 936e149 + be01344 commit a3434c8
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,23 @@ def to_log_record_data
end

it 'removes the older log records from the batch if full' do
processor = BatchLogRecordProcessor.new(TestExporter.new, max_queue_size: 1, max_export_batch_size: 1)
# Windows intermittently fails if we don't set this
OpenTelemetry::TestHelpers.with_env('OTEL_RUBY_BLRP_START_THREAD_ON_BOOT' => 'false') do
processor = BatchLogRecordProcessor.new(TestExporter.new, max_queue_size: 1, max_export_batch_size: 1)

# Don't actually try to export, we're looking at the log records array
processor.stub(:work, nil) do
older_log_record = TestLogRecord.new
newest_log_record = TestLogRecord.new
# Don't actually try to export, we're looking at the log records array
processor.stub(:work, nil) do
older_log_record = TestLogRecord.new
newest_log_record = TestLogRecord.new

processor.on_emit(older_log_record, mock_context)
processor.on_emit(newest_log_record, mock_context)
processor.on_emit(older_log_record, mock_context)
processor.on_emit(newest_log_record, mock_context)

records = processor.instance_variable_get(:@log_records)
records = processor.instance_variable_get(:@log_records)

assert_includes(records, newest_log_record)
refute_includes(records, older_log_record)
assert_includes(records, newest_log_record)
refute_includes(records, older_log_record)
end
end
end

Expand Down

0 comments on commit a3434c8

Please sign in to comment.