File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1414
1515MAIN_CC_NAME = "main"
1616
17+ OPERATOR_DEPLOYMENT = "metalk8s-operator-controller-manager"
18+ OPERATOR_NAMESPACE = "kube-system"
19+
20+
21+ @pytest .fixture (autouse = True , scope = "module" )
22+ def restart_operator_after_ingress_tests (host ):
23+ """Reset the operator CrashLoopBackOff timer after all ingress tests.
24+
25+ Ingress tests heavily modify the ClusterConfig, which can cause the
26+ operator to panic and enter CrashLoopBackOff with increasing backoff
27+ delays. A rollout restart at the end of this module ensures the
28+ operator pod starts fresh (restartCount=0) before subsequent test
29+ modules (e.g. test_operator) that depend on quick operator recovery.
30+ """
31+ yield
32+ with host .sudo ():
33+ host .check_output (
34+ "kubectl --kubeconfig=/etc/kubernetes/admin.conf "
35+ f"rollout restart deployment/{ OPERATOR_DEPLOYMENT } --namespace { OPERATOR_NAMESPACE } "
36+ )
37+ host .check_output (
38+ "kubectl --kubeconfig=/etc/kubernetes/admin.conf "
39+ f"rollout status deployment/{ OPERATOR_DEPLOYMENT } --namespace { OPERATOR_NAMESPACE } --timeout=120s"
40+ )
41+
1742
1843@scenario ("../features/ingress.feature" , "Access HTTP services" )
1944def test_access_http_services (host ):
You can’t perform that action at this time.
0 commit comments