mirror of
https://github.com/opencontainers/runc.git
synced 2025-11-01 11:32:44 +08:00
Bumps [github.com/cilium/ebpf](https://github.com/cilium/ebpf) from 0.16.0 to 0.17.0. - [Release notes](https://github.com/cilium/ebpf/releases) - [Commits](https://github.com/cilium/ebpf/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: github.com/cilium/ebpf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
32 lines
392 B
Go
32 lines
392 B
Go
package fdtrace
|
|
|
|
import (
|
|
"os"
|
|
"sync"
|
|
)
|
|
|
|
type testingM interface {
|
|
Run() int
|
|
}
|
|
|
|
// TestMain runs m with fd tracing enabled.
|
|
//
|
|
// The function calls [os.Exit] and does not return.
|
|
func TestMain(m testingM) {
|
|
fds = new(sync.Map)
|
|
|
|
ret := m.Run()
|
|
|
|
if fs := flushFrames(); len(fs) != 0 {
|
|
for _, f := range fs {
|
|
onLeakFD(f)
|
|
}
|
|
}
|
|
|
|
if foundLeak.Load() {
|
|
ret = 99
|
|
}
|
|
|
|
os.Exit(ret)
|
|
}
|