Commit Graph

6 Commits

Author SHA1 Message Date
Benjamin Elder
c6c68a73e1 remove oom TestStartingWatcher ""unit"" test 2020-05-08 23:25:28 -07:00
David Ashpole
fc6b4719fd Use the container whose limit is hit for system OOMs 2020-03-06 11:06:16 -08:00
mattjmcnaughton
9077603b97
Add richer unit tests for OomWatcher
Add unit tests for OomWatcher that actually test the logic defined in
the `Start` method. As a result of an earlier refactor, its now trivial
to mock the OOMInstance events which the `oom_watcher` is supposed to be
watching.
2020-01-14 07:57:06 -05:00
mattjmcnaughton
8897c435ad
Refactor oom watcher to allow greater test coverage
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.
2020-01-07 21:48:14 -05:00
obitech
9e35d3d709 Fix golint issues in pkg/kubelet/oom 2019-04-27 10:00:07 +02:00
WanLinghao
b2ce446a88 Migrate oom watcher not relying on cAdviosr any more, it is part of plan
of removing cAdvisor from k8s.
For more informations about this plan, please refer:
https://github.com/kubernetes/kubernetes/issues/68522
2019-03-05 17:06:34 +08:00