Skip to content

Commit

Permalink
Fix NodeConfig e2e race check with node setup daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
tnozicka committed Aug 29, 2024
1 parent a677b2b commit 4578109
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/set/nodeconfig/nodeconfig_optimizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ var _ = g.Describe("NodeConfig Optimizations", framework.Serial, func() {
framework.By("Waiting for the NodeConfig to deploy")
ctx1, ctx1Cancel := context.WithTimeout(ctx, nodeConfigRolloutTimeout)
defer ctx1Cancel()
o.Expect(matchingNodes).NotTo(o.BeEmpty())
nc, err = controllerhelpers.WaitForNodeConfigState(
ctx1,
f.ScyllaAdminClient().ScyllaV1alpha1().NodeConfigs(),
nc.Name,
controllerhelpers.WaitForStateOptions{TolerateDelete: false},
utils.IsNodeConfigRolledOut,
utils.IsNodeConfigDoneWithNodeTuningFunc(matchingNodes),
utils.IsNodeConfigDoneWithNodes(matchingNodes),
)
o.Expect(err).NotTo(o.HaveOccurred())

Expand Down
5 changes: 5 additions & 0 deletions test/e2e/utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func IsNodeConfigDoneWithNodes(nodes []*corev1.Node) func(nc *scyllav1alpha1.Nod
)

return func(nc *scyllav1alpha1.NodeConfig) (bool, error) {
if len(nodes) == 0 {
return true, fmt.Errorf("nodes can't be empty")
}

for _, node := range nodes {
if nc.Status.ObservedGeneration < nc.Generation {
return false, nil
Expand All @@ -93,6 +97,7 @@ func IsNodeConfigDoneWithNodes(nodes []*corev1.Node) func(nc *scyllav1alpha1.Nod
return false, nil
}
}

return true, nil
}
}
Expand Down

0 comments on commit 4578109

Please sign in to comment.