mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Clean shutdown of cronjob integration tests
This commit is contained in:
parent
64d1b24cc8
commit
3af4c74f37
@ -155,12 +155,12 @@ func TestCronJobLaunchesPodAndCleansUp(t *testing.T) {
|
|||||||
|
|
||||||
cjClient := clientSet.BatchV1().CronJobs(ns.Name)
|
cjClient := clientSet.BatchV1().CronJobs(ns.Name)
|
||||||
|
|
||||||
stopCh := make(chan struct{})
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer close(stopCh)
|
defer cancel()
|
||||||
|
|
||||||
informerSet.Start(stopCh)
|
informerSet.Start(ctx.Done())
|
||||||
go cjc.Run(context.TODO(), 1)
|
go cjc.Run(ctx, 1)
|
||||||
go jc.Run(context.TODO(), 1)
|
go jc.Run(ctx, 1)
|
||||||
|
|
||||||
_, err := cjClient.Create(context.TODO(), newCronJob(cronJobName, ns.Name, "* * * * ?"), metav1.CreateOptions{})
|
_, err := cjClient.Create(context.TODO(), newCronJob(cronJobName, ns.Name, "* * * * ?"), metav1.CreateOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user