Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for a stable cluster in the suite #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ func TestE2e(t *testing.T) {
})
}

if err := ctx.waitForStableCluster(); err != nil {
t.Error(err)
}

var scanN int

for scanN = 2; scanN < 5; scanN++ {
Expand Down
8 changes: 8 additions & 0 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ func (ctx *e2econtext) waitForMachinePoolUpdate(t *testing.T, name string) {
}
}

func (ctx *e2econtext) waitForStableCluster() error {
_, err := exec.Command("oc", "adm", "wait-for-stable-cluster", "--minimum-stable-period=2m").Output()
Copy link
Collaborator Author

@rhmdnd rhmdnd Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assumption here is that we don't care about the command output, just that it doesn't timeout waiting for a stable cluster.

Using a client library here instead would be nice because it might give us more useful error messages without having to parse raw output.

Copy link

@xiaojiey xiaojiey Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the testing for PR ComplianceAsCode/content#12220, the remediation took about 25-30 minutes for a 6 node cluster. Otherwise the ingress or apisever will be in updating status..

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the cluster be modified to have a faster rollout? Machine config operate used to have such an option

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - that's a significant increase in our testing times. I'll do some digging around to see if there is a way to speed this up.

if err != nil {
return errors.New(fmt.Sprintf("E2E-FAILURE: Cluster failed to stablize after applying remediations: %s", err))
}
return nil
}

func (ctx *e2econtext) doRescan(t *testing.T, s string) {
scanList := &cmpv1alpha1.ComplianceScanList{}
// nolint:errcheck
Expand Down