This diff contains a strict refactor; there are no behavioral changes. Address a long standing TODO in `oom_watcher_linux_test.go` around test coverage. We refactor our `oom.Watcher` so it takes in a struct fulfulling the `streamer` interface (i.e. defines `StreamOoms` method). In production, we will continue to use the `oomparser` from `cadvisor`. However, for testing purposes, we can now create our own `fakeStreamer`, and control how it streams `oomparser.OomInstance`. With this fake, we can implement richer unit testing for the `oom.Watcher` itself. Actually adding the additional unit tests will come in a later commit.
1.2 KiB
1.2 KiB