mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Merge pull request #126292 from googs1025/scheduler_ut
scheduler(ut): call close method when finish profileMap in ut
This commit is contained in:
commit
af782d05aa
@ -251,6 +251,16 @@ func TestNewMap(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
m, err := NewMap(ctx, tc.cfgs, fakeRegistry, nilRecorderFactory)
|
||||
defer func() {
|
||||
if m != nil {
|
||||
// to close all frameworks registered in this map.
|
||||
err := m.Close()
|
||||
if err != nil {
|
||||
t.Errorf("error closing map: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
if err := checkErr(err, tc.wantErr); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user