cilium / ebpf

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.
https://ebpf-go.dev
MIT License
6.32k stars 697 forks source link

flake: TestMapIteratorAllocations #1449

Open lmb opened 6 months ago

lmb commented 6 months ago

Describe the bug

Seems like TestMapIteratorAllocations is flaky.

=== FAIL: . TestMapIteratorAllocations (0.03s)
    quicktest.go:12: 
        error:
          values are not equal
        got:
          float64(1)
        want:
          float64(0)
        stack:
          /home/runner/work/ebpf/ebpf/map_test.go:1124
            qt.Assert(t, qt.Equals(allocs, float64(0)))

How to reproduce

$ go test -exec sudo -run TestMapIteratorAllocations -count 10000 .
--- FAIL: TestMapIteratorAllocations (0.00s)
    quicktest.go:12: 
        error:
          values are not equal
        got:
          float64(1)
        want:
          float64(0)
        stack:
          /home/lorenz/dev/ebpf/map_test.go:1124
            qt.Assert(t, qt.Equals(allocs, float64(0)))

--- FAIL: TestMapIteratorAllocations (0.00s)
    quicktest.go:12: 
        error:
          values are not equal
        got:
          float64(1)
        want:
          float64(0)
        stack:
          /home/lorenz/dev/ebpf/map_test.go:1124
            qt.Assert(t, qt.Equals(allocs, float64(0)))

FAIL
FAIL    github.com/cilium/ebpf  0.532s
FAIL

Version information

main

ZhangYet commented 3 months ago

Could you describe the env with more detail?

I cannot reproduce this problem with:

CPU: Intel i7-8700K 3.7GHz Mem: 32G Kernel version: 6.9.10-arch1-1

I ran go test -exec sudo -run TestMapIteratorAllocations -count 10000 . multiple times and didn't reproduce the same error.