Skip to content

Commit 8875d6a

Browse files
committed
Remove otel workaround test
Signed-off-by: Derek McGowan <[email protected]>
1 parent 0de84cf commit 8875d6a

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

cmd/dockerd/daemon_test.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package main
22

33
import (
4-
"runtime"
54
"testing"
65

76
"github.com/containerd/log"
87
"github.com/docker/docker/daemon/config"
98
"github.com/google/go-cmp/cmp/cmpopts"
109
"github.com/spf13/pflag"
11-
"go.opentelemetry.io/otel"
1210
"gotest.tools/v3/assert"
1311
is "gotest.tools/v3/assert/cmp"
1412
"gotest.tools/v3/fs"
@@ -281,29 +279,3 @@ func TestCDISpecDirs(t *testing.T) {
281279
})
282280
}
283281
}
284-
285-
// TestOtelMeterLeak tests for a memory leak in the OTEL meter implementation.
286-
// Once the fixed OTEL is vendored, this test will fail - the workaround
287-
// and this test should be removed then.
288-
func TestOtelMeterLeak(t *testing.T) {
289-
meter := otel.Meter("foo")
290-
291-
var before runtime.MemStats
292-
runtime.ReadMemStats(&before)
293-
294-
const counters = 10 * 1000 * 1000
295-
for i := 0; i < counters; i++ {
296-
_, _ = meter.Int64Counter("bar")
297-
}
298-
299-
var after runtime.MemStats
300-
runtime.ReadMemStats(&after)
301-
302-
allocs := after.Mallocs - before.Mallocs
303-
t.Log("Allocations:", allocs)
304-
305-
if allocs < 10 {
306-
// TODO: Remove Workaround OTEL memory leak in cmd/dockerd/daemon.go
307-
t.Fatal("Allocations count decreased. OTEL leak workaround is no longer needed!")
308-
}
309-
}

0 commit comments

Comments
 (0)