mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #114564 from pohly/e2e-ginkgo-timeout-fixes
e2e ginkgo timeout fixes
This commit is contained in:
commit
7cf7cc2dfb
@ -216,7 +216,6 @@ var _ = SIGDescribe("DaemonRestart [Disruptive]", func() {
|
|||||||
var config testutils.RCConfig
|
var config testutils.RCConfig
|
||||||
var controller cache.Controller
|
var controller cache.Controller
|
||||||
var newPods cache.Store
|
var newPods cache.Store
|
||||||
var stopCh chan struct{}
|
|
||||||
var tracker *podTracker
|
var tracker *podTracker
|
||||||
|
|
||||||
ginkgo.BeforeEach(func(ctx context.Context) {
|
ginkgo.BeforeEach(func(ctx context.Context) {
|
||||||
@ -237,18 +236,21 @@ var _ = SIGDescribe("DaemonRestart [Disruptive]", func() {
|
|||||||
framework.ExpectNoError(e2erc.RunRC(ctx, config))
|
framework.ExpectNoError(e2erc.RunRC(ctx, config))
|
||||||
replacePods(*config.CreatedPods, existingPods)
|
replacePods(*config.CreatedPods, existingPods)
|
||||||
|
|
||||||
stopCh = make(chan struct{})
|
// The following code continues to run after the BeforeEach and thus
|
||||||
|
// must not use ctx.
|
||||||
|
backgroundCtx, cancel := context.WithCancel(context.Background())
|
||||||
|
ginkgo.DeferCleanup(cancel)
|
||||||
tracker = newPodTracker()
|
tracker = newPodTracker()
|
||||||
newPods, controller = cache.NewInformer(
|
newPods, controller = cache.NewInformer(
|
||||||
&cache.ListWatch{
|
&cache.ListWatch{
|
||||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||||
options.LabelSelector = labelSelector.String()
|
options.LabelSelector = labelSelector.String()
|
||||||
obj, err := f.ClientSet.CoreV1().Pods(ns).List(ctx, options)
|
obj, err := f.ClientSet.CoreV1().Pods(ns).List(backgroundCtx, options)
|
||||||
return runtime.Object(obj), err
|
return runtime.Object(obj), err
|
||||||
},
|
},
|
||||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||||
options.LabelSelector = labelSelector.String()
|
options.LabelSelector = labelSelector.String()
|
||||||
return f.ClientSet.CoreV1().Pods(ns).Watch(ctx, options)
|
return f.ClientSet.CoreV1().Pods(ns).Watch(backgroundCtx, options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&v1.Pod{},
|
&v1.Pod{},
|
||||||
@ -265,11 +267,7 @@ var _ = SIGDescribe("DaemonRestart [Disruptive]", func() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
go controller.Run(stopCh)
|
go controller.Run(backgroundCtx.Done())
|
||||||
})
|
|
||||||
|
|
||||||
ginkgo.AfterEach(func() {
|
|
||||||
close(stopCh)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("Controller Manager should not create/delete replicas across restart", func(ctx context.Context) {
|
ginkgo.It("Controller Manager should not create/delete replicas across restart", func(ctx context.Context) {
|
||||||
|
@ -579,7 +579,7 @@ var _ = SIGDescribe("Kubectl client", func() {
|
|||||||
if !strings.Contains(ee.String(), "timed out") {
|
if !strings.Contains(ee.String(), "timed out") {
|
||||||
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
||||||
}
|
}
|
||||||
framework.ExpectNoError(e2epod.WaitForPodToDisappear(ctx, f.ClientSet, ns, "failure-3", labels.Everything(), 2*time.Second, wait.ForeverTestTimeout))
|
framework.ExpectNoError(e2epod.WaitForPodToDisappear(ctx, f.ClientSet, ns, "failure-3", labels.Everything(), 2*time.Second, 2*v1.DefaultTerminationGracePeriodSeconds*time.Second))
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("[Slow] running a failing command with --leave-stdin-open", func(ctx context.Context) {
|
ginkgo.It("[Slow] running a failing command with --leave-stdin-open", func(ctx context.Context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user