Merge pull request #108010 from endocrimes/dani/eviction-flake

eviction: Deflake TestStart
This commit is contained in:
Kubernetes Prow Robot 2022-03-17 12:22:54 -07:00 committed by GitHub
commit 56062f7f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,8 +174,11 @@ func TestStart(t *testing.T) {
notifierFactory.EXPECT().NewCgroupNotifier(testCgroupPath, memoryUsageAttribute, int64(0)).Return(notifier, nil).Times(1)
var events chan<- struct{} = m.events
notifier.EXPECT().Start(events).Return()
notifier.EXPECT().Stop().Return().AnyTimes()
notifier.EXPECT().Start(events).DoAndReturn(func(events chan<- struct{}) {
for i := 0; i < 4; i++ {
events <- struct{}{}
}
})
err := m.UpdateThreshold(nodeSummary(noResources, noResources, noResources, isAllocatableEvictionThreshold(threshold)))
if err != nil {
@ -184,9 +187,6 @@ func TestStart(t *testing.T) {
go m.Start()
for i := 0; i < 4; i++ {
m.events <- struct{}{}
}
wg.Wait()
}