kubernetes/pkg/kubelet/eviction
Danielle Lancashire 3630328fd9 eviction: Deflake TestStart
TestStart was previously flaky. In approx 100_000 local runs, it failed
about 70% of the time, and has been mentioned as a flaky unit test in
the past.

This flake was due to a race condition with the logic as written and the
go scheduler. UpdateThreshold calls `notifier.Start(events)` in a new Go
Routine, which is not guarunteed to be called immediately.

This meant that if `m.Start()` was called before `notifier.Start()`, the
test would fail, as the notifier would not have been started before the
4 events were processed and lock released.

Here, we update the test to more closely match the intended application
behaviour, and have events passed to the channel when `Start` is called
on the notifier.

This ensures that -Start gets called and additionally validates
that the correct channel is provided to the notifier.

Stop was never called previously, as it only gets called on a subsequent
call to UpdateThreshold. `AnyTimes()` hid that this did not occur.
2022-02-08 17:03:44 +01:00
..
api Merge pull request #97493 from Pingan2017/allocatemem-1224 2021-03-07 20:09:44 -08:00
doc.go
eviction_manager_test.go Merge pull request #104933 from vikramcse/automate_mockery 2021-09-30 18:33:21 -07:00
eviction_manager.go fix: typo 2021-11-17 09:22:57 +08:00
helpers_test.go Add test cases to the addAllocatableThresholds function in pkg/kubelet/eviction/helpers.go 2021-06-15 11:32:44 +00:00
helpers.go avoid klog Info calls without verbosity 2022-01-12 07:48:36 +01:00
memory_threshold_notifier_test.go eviction: Deflake TestStart 2022-02-08 17:03:44 +01:00
memory_threshold_notifier.go Structured Logging migration: modify eviction part logs of kubelet. 2021-02-21 08:36:14 +08:00
mock_threshold_notifier_test.go mockery to mockgen conversion 2021-09-25 16:15:08 +00:00
threshold_notifier_linux.go kubelet: cgroupv2 disable memcg notifications 2021-11-10 15:40:59 -08:00
threshold_notifier_unsupported.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
types.go mockery to mockgen conversion 2021-09-25 16:15:08 +00:00