Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add workaround for Windows logs SDK test failure #1751

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading