Skip to content

Commit 77a751e

Browse files
Merge pull request #29981 from isabella-janssen/ocpbugs-59203
OCPBUGS-59203: OCPBUGS-57524: Improve MCN test stability
2 parents 03e488f + 8634ed7 commit 77a751e

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

test/extended/machine_config/helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ func GetNodeInMachine(oc *exutil.CLI, machineName string) (corev1.Node, error) {
10021002
return *node, nil
10031003
}
10041004

1005-
// `GetNewReadyNodeInMachine` waits up to 2 minutes for the newly provisioned node in a desired machine node to be ready
1005+
// `GetNewReadyNodeInMachine` waits up to 4 minutes for the newly provisioned node in a desired machine node to be ready
10061006
func GetNewReadyNodeInMachine(oc *exutil.CLI, machineName string) (corev1.Node, error) {
10071007
desiredNode := corev1.Node{}
10081008
err := fmt.Errorf("no ready node in Machine: %s", machineName)
@@ -1021,7 +1021,7 @@ func GetNewReadyNodeInMachine(oc *exutil.CLI, machineName string) (corev1.Node,
10211021
}
10221022

10231023
return false
1024-
}, 2*time.Minute, 3*time.Second).Should(o.BeTrue())
1024+
}, 4*time.Minute, 5*time.Second).Should(o.BeTrue(), fmt.Sprintf("Node in machine %v never became ready.", machineName))
10251025
return desiredNode, err
10261026
}
10271027

test/extended/machine_config/machine_config_node.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var _ = g.Describe("[Suite:openshift/machine-config-operator/disruptive][sig-mco
9191
ValidateMCNScopeImpersonationPathTest(oc)
9292
})
9393

94-
g.It("[Suite:openshift/conformance/parallel]Should properly update the MCN from the associated MCD [apigroup:machineconfiguration.openshift.io]", func() {
94+
g.It("[Suite:openshift/conformance/serial][Serial]Should properly update the MCN from the associated MCD [apigroup:machineconfiguration.openshift.io]", func() {
9595
ValidateMCNScopeHappyPathTest(oc)
9696
})
9797
})
@@ -406,16 +406,27 @@ func ValidateMCNConditionOnNodeDegrade(oc *exutil.CLI, fixture string, isSno boo
406406
o.Expect(degradedNodeErr).NotTo(o.HaveOccurred(), "Could not get degraded node.")
407407

408408
// Validate MCN of degraded node
409+
// get and log MCN conditions for debugging purposes
409410
degradedNodeMCN, degradedErr = clientSet.MachineconfigurationV1().MachineConfigNodes().Get(context.TODO(), degradedNode.Name, metav1.GetOptions{})
410411
o.Expect(degradedErr).NotTo(o.HaveOccurred(), fmt.Sprintf("Error getting MCN of degraded node '%v'.", degradedNode.Name))
411-
framework.Logf("Validating that `AppliedFilesAndOS` and `UpdateExecuted` conditions in '%v' MCN have a status of 'Unknown'.", degradedNodeMCN.Name)
412-
o.Expect(CheckMCNConditionStatus(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateFilesAndOS, metav1.ConditionUnknown)).Should(o.BeTrue(), "Condition 'AppliedFilesAndOS' does not have the expected status of 'Unknown'.")
413-
o.Expect(CheckMCNConditionStatus(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateExecuted, metav1.ConditionUnknown)).Should(o.BeTrue(), "Condition 'UpdateExecuted' does not have the expected status of 'Unknown'.")
414412
nodeDegradedCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeNodeDegraded)
415-
o.Expect(nodeDegradedCondition).NotTo(o.BeNil())
413+
o.Expect(nodeDegradedCondition).NotTo(o.BeNil(), "Condition 'NodeDegraded' does not exist.")
414+
framework.Logf("`NodeDegraded` condition status is `%v` with the message `%v`", nodeDegradedCondition.Status, nodeDegradedCondition.Message)
415+
filesAndOSCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateFilesAndOS)
416+
o.Expect(filesAndOSCondition).NotTo(o.BeNil(), "Condition 'AppliedFilesAndOS' does not exist.")
417+
framework.Logf("`AppliedFilesAndOS` condition status is `%v` with the message `%v`", filesAndOSCondition.Status, filesAndOSCondition.Message)
418+
executedCondition := GetMCNCondition(degradedNodeMCN, mcfgv1.MachineConfigNodeUpdateExecuted)
419+
o.Expect(executedCondition).NotTo(o.BeNil(), "Condition 'UpdateExecuted' does not exist.")
420+
framework.Logf("`UpdateExecuted` condition status is `%v` with the message `%v`", executedCondition.Status, executedCondition.Message)
421+
// validate the conditions are as expected
422+
framework.Logf("Validating that `NodeDegraded` condition in '%v' MCN has a status of 'True'.", degradedNodeMCN.Name)
416423
o.Expect(nodeDegradedCondition.Status).Should(o.Equal(metav1.ConditionTrue), "Condition 'NodeDegraded' does not have the expected status of 'True'.")
417424
o.Expect(nodeDegradedCondition.Message).Should(o.ContainSubstring(fmt.Sprintf("Node %s upgrade failure.", degradedNodeMCN.Name)), "Condition 'NodeDegraded' does not have the expected message.")
418425
o.Expect(nodeDegradedCondition.Message).Should(o.ContainSubstring("/home/core: file exists"), "Condition 'NodeDegraded' does not have the expected message details.")
426+
framework.Logf("Validating that `UpdateExecuted` condition in '%v' MCN has a status of 'Unknown'.", degradedNodeMCN.Name)
427+
o.Expect(executedCondition.Status).Should(o.Equal(metav1.ConditionUnknown), "Condition 'UpdateExecuted' does not have the expected status of 'Unknown'.")
428+
framework.Logf("Validating that `AppliedFilesAndOS` condition in '%v' MCN has a status of 'Unknown'.", degradedNodeMCN.Name)
429+
o.Expect(filesAndOSCondition.Status).Should(o.Equal(metav1.ConditionUnknown), "Condition 'AppliedFilesAndOS' does not have the expected status of 'Unknown'.")
419430
}
420431

421432
// `ValidateMCNProperties` checks that MCNs with correct properties are created on node creation

test/extended/util/annotate/generated/zz_generated.annotations.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zz_generated.manifests/test-reporting.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ spec:
184184
- testName: '[Suite:openshift/machine-config-operator/disruptive][sig-mco][OCPFeatureGate:MachineConfigNodes]
185185
[Suite:openshift/conformance/parallel]Should properly block MCN updates from
186186
a MCD that is not the associated one [apigroup:machineconfiguration.openshift.io]'
187-
- testName: '[Suite:openshift/machine-config-operator/disruptive][sig-mco][OCPFeatureGate:MachineConfigNodes]
188-
[Suite:openshift/conformance/parallel]Should properly update the MCN from
189-
the associated MCD [apigroup:machineconfiguration.openshift.io]'
190187
- testName: '[Suite:openshift/machine-config-operator/disruptive][sig-mco][OCPFeatureGate:MachineConfigNodes]
191188
[Suite:openshift/conformance/serial][Serial]Should have MCN properties matching
192189
associated node properties for nodes in custom MCPs [apigroup:machineconfiguration.openshift.io]'
193190
- testName: '[Suite:openshift/machine-config-operator/disruptive][sig-mco][OCPFeatureGate:MachineConfigNodes]
194191
[Suite:openshift/conformance/serial][Serial]Should properly transition through
195192
MCN conditions on rebootless node update [apigroup:machineconfiguration.openshift.io]'
193+
- testName: '[Suite:openshift/machine-config-operator/disruptive][sig-mco][OCPFeatureGate:MachineConfigNodes]
194+
[Suite:openshift/conformance/serial][Serial]Should properly update the MCN
195+
from the associated MCD [apigroup:machineconfiguration.openshift.io]'
196196
- featureGate: ManagedBootImages
197197
tests:
198198
- testName: '[Suite:openshift/machine-config-operator/disruptive][Suite:openshift/conformance/serial][sig-mco][OCPFeatureGate:ManagedBootImages][Serial]

0 commit comments

Comments
 (0)