mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +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)
|
||||
|
||||
stopCh := make(chan struct{})
|
||||
defer close(stopCh)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
informerSet.Start(stopCh)
|
||||
go cjc.Run(context.TODO(), 1)
|
||||
go jc.Run(context.TODO(), 1)
|
||||
informerSet.Start(ctx.Done())
|
||||
go cjc.Run(ctx, 1)
|
||||
go jc.Run(ctx, 1)
|
||||
|
||||
_, err := cjClient.Create(context.TODO(), newCronJob(cronJobName, ns.Name, "* * * * ?"), metav1.CreateOptions{})
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user