mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #108010 from endocrimes/dani/eviction-flake
eviction: Deflake TestStart
This commit is contained in:
commit
56062f7f4f
@ -174,8 +174,11 @@ func TestStart(t *testing.T) {
|
|||||||
notifierFactory.EXPECT().NewCgroupNotifier(testCgroupPath, memoryUsageAttribute, int64(0)).Return(notifier, nil).Times(1)
|
notifierFactory.EXPECT().NewCgroupNotifier(testCgroupPath, memoryUsageAttribute, int64(0)).Return(notifier, nil).Times(1)
|
||||||
|
|
||||||
var events chan<- struct{} = m.events
|
var events chan<- struct{} = m.events
|
||||||
notifier.EXPECT().Start(events).Return()
|
notifier.EXPECT().Start(events).DoAndReturn(func(events chan<- struct{}) {
|
||||||
notifier.EXPECT().Stop().Return().AnyTimes()
|
for i := 0; i < 4; i++ {
|
||||||
|
events <- struct{}{}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
err := m.UpdateThreshold(nodeSummary(noResources, noResources, noResources, isAllocatableEvictionThreshold(threshold)))
|
err := m.UpdateThreshold(nodeSummary(noResources, noResources, noResources, isAllocatableEvictionThreshold(threshold)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -184,9 +187,6 @@ func TestStart(t *testing.T) {
|
|||||||
|
|
||||||
go m.Start()
|
go m.Start()
|
||||||
|
|
||||||
for i := 0; i < 4; i++ {
|
|
||||||
m.events <- struct{}{}
|
|
||||||
}
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user