1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Fix exemplar tests in containerized environments (#8188)

The actual default reservoir provider uses runtime.GOMAXPROCS(0) to work
properly in containerized environments. When I was running the test, the
fact that the test used runtime.NumCPU() caused the test to fail.


https://github.com/open-telemetry/opentelemetry-go/blob/48dd8b1a0975e14a09d615f8ee80212b20f1e107/sdk/metric/exemplar.go#L70-L73
This commit is contained in:
David Ashpole
2026-04-14 10:26:22 -04:00
committed by GitHub
parent f8043775c3
commit 88a71eeb67
+1 -1
View File
@@ -402,7 +402,7 @@ func TestInserterCachedAggregatorNameConflict(t *testing.T) {
}
func TestExemplars(t *testing.T) {
nCPU := runtime.NumCPU()
nCPU := max(runtime.GOMAXPROCS(0), 1)
setup := func(name string) (metric.Meter, Reader) {
r := NewManualReader()
v := NewView(Instrument{Name: "int64-expo-histogram"}, Stream{