1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-30 21:20:04 +02:00
opentelemetry-go/sdk/log
Anton Manakin 982e96dd9b
sdk/log: Fix TestBatchProcessor/DroppedLogs flaky test (#5421)
Fix #5384

Run of `go test  -count=1000000 -run="TestBatchProcessor/DroppedLogs"`
**Before**:
Failed with either `Condition never satisfied` or panic
**After**:
Passed

First, bytes.Buffer is not thread-safe, so writing log and reading
(`bytes.String()`) caused panic. Added `concurrentBuffer`
Second, fixed flaky test with 4 records:
1. Record goes to `testExporter.Export` function and blocks in this
function because of `ExportTrigger`
(19ee6d4775/sdk/log/exporter_test.go (L87))
2. Record goes to `bufferExporter.input`
(7c5e64cccc/sdk/log/exporter.go (L129))
3. Record goes to `BatchProcessor.q` queue and it could not be enqueued
to export, because `bufferExporter.input` is full
4. Record goes to `BatchProcessor.q` and because of overfill, drops
third record

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-05-29 11:19:57 -07:00
..
logtest Use reflect to construct a Record in logtest (#5275) 2024-05-06 09:03:14 -07:00
batch_test.go sdk/log: Fix TestBatchProcessor/DroppedLogs flaky test (#5421) 2024-05-29 11:19:57 -07:00
batch.go chore(deps): update dependency codespell to v2.3.0 (#5409) 2024-05-24 18:09:31 +02:00
DESIGN.md chore(deps): update dependency codespell to v2.3.0 (#5409) 2024-05-24 18:09:31 +02:00
doc.go sdk/log: Scaffolding (#5068) 2024-03-13 17:47:07 +01:00
exporter_test.go Fix flaky test TestBufferExporter/Shutdown/ContextCancelled (#5261) 2024-04-25 17:46:39 +02:00
exporter.go chore(deps): update dependency codespell to v2.3.0 (#5409) 2024-05-24 18:09:31 +02:00
go.mod fix(deps): update module github.com/go-logr/logr to v1.4.2 (#5393) 2024-05-21 13:58:14 -07:00
go.sum fix(deps): update module github.com/go-logr/logr to v1.4.2 (#5393) 2024-05-21 13:58:14 -07:00
logger_bench_test.go sdk/log: Fix BenchmarkLoggerNewRecord to not drop attributes (#5407) 2024-05-24 08:07:56 +02:00
logger_norace_test.go Replace Record limit methods with DroppedAttributes (#5190) 2024-04-16 11:48:17 -07:00
logger_test.go Replace Record limit methods with DroppedAttributes (#5190) 2024-04-16 11:48:17 -07:00
logger.go sdk/log: ObservedTimestamp should be set (#5091) 2024-03-22 07:39:01 -07:00
processor.go Add the Enabled method to the Logger (#5071) 2024-03-15 08:15:44 -07:00
provider_test.go Implement the BatchingProcessor configuration (#5088) 2024-03-25 07:50:19 -07:00
provider.go chore(deps): update dependency codespell to v2.3.0 (#5409) 2024-05-24 18:09:31 +02:00
README.md Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
record_test.go Log a warning when log Record attribute is dropped (#5376) 2024-05-28 11:12:53 -07:00
record.go Log a warning when log Record attribute is dropped (#5376) 2024-05-28 11:12:53 -07:00
ring_test.go Add custom ring implementation to the BatchProcessor (#5237) 2024-04-24 12:07:15 +02:00
ring.go Add custom ring implementation to the BatchProcessor (#5237) 2024-04-24 12:07:15 +02:00
setting_test.go Implement the BatchingProcessor configuration (#5088) 2024-03-25 07:50:19 -07:00
setting.go Clamp batch size <= queue size (#5157) 2024-04-05 16:02:32 -07:00
simple_test.go Implement the SimpleProcessor (#5079) 2024-03-17 07:47:05 -07:00
simple.go sdk/log: Rename BatchingProcessor to BatchProcessor (#5229) 2024-04-19 08:34:30 +02:00

Log SDK

PkgGoDev