mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
e2e scheduling: remove redundant stopCh
The ctx.Done() channel associated with the current test can be used instead. This is a simplification, both approaches work.
This commit is contained in:
parent
29d6d03a3c
commit
1bc24630da
@ -623,7 +623,6 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
|
|||||||
*/
|
*/
|
||||||
framework.ConformanceIt("runs ReplicaSets to verify preemption running path", func(ctx context.Context) {
|
framework.ConformanceIt("runs ReplicaSets to verify preemption running path", func(ctx context.Context) {
|
||||||
podNamesSeen := []int32{0, 0, 0}
|
podNamesSeen := []int32{0, 0, 0}
|
||||||
stopCh := make(chan struct{})
|
|
||||||
|
|
||||||
// create a pod controller to list/watch pod events from the test framework namespace
|
// create a pod controller to list/watch pod events from the test framework namespace
|
||||||
_, podController := cache.NewInformer(
|
_, podController := cache.NewInformer(
|
||||||
@ -652,8 +651,7 @@ var _ = SIGDescribe("SchedulerPreemption [Serial]", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
go podController.Run(stopCh)
|
go podController.Run(ctx.Done())
|
||||||
defer close(stopCh)
|
|
||||||
|
|
||||||
// prepare three ReplicaSet
|
// prepare three ReplicaSet
|
||||||
rsConfs := []pauseRSConfig{
|
rsConfs := []pauseRSConfig{
|
||||||
|
Loading…
Reference in New Issue
Block a user