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

Tests for Runaway Control Loops #361

Merged
merged 1 commit into from
Jun 18, 2018

Conversation

alecmerdler
Copy link
Member

Description

Adds checks in the e2e tests to ensure that the Operators are not rapidly processing OLM custom resources.

Addresses https://jira.coreos.com/browse/ALM-581

@alecmerdler alecmerdler added the internal/tracked This issue is tracked in the internal JIRA label May 30, 2018
@@ -116,6 +116,12 @@ var csvReplacingChecker = func(csv *v1alpha1.ClusterServiceVersion) bool {
return csv.Status.Phase == v1alpha1.CSVPhaseReplacing || csv.Status.Phase == v1alpha1.CSVPhaseDeleting
}

var csvResourceVersionCheckerFor = func(csv *v1alpha1.ClusterServiceVersion) csvConditionChecker {
return func(fetchedCSV *v1alpha1.ClusterServiceVersion) bool {
return csv.GetResourceVersion() == fetchedCSV.GetResourceVersion()
Copy link
Member Author

Choose a reason for hiding this comment

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

@ecordell what do you think of this approach to catching regressions like this?

Copy link
Member

Choose a reason for hiding this comment

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

This will work if we're careful to use it correctly. Calling it twice in a row probably won't find the issues, but calling it once, waiting for a period of time that we don't expect changes to have occurred, and then calling it again will.

Copy link
Member

@ecordell ecordell May 30, 2018

Choose a reason for hiding this comment

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

Whenever we hit a known state that we don't expect to change, we could just go ahead and defer a check for the resourceVersion.

If that's not enough, we could keep a registry of resourceVersionChecks for the entire testsuite, and then check them as a final test.

@alecmerdler alecmerdler force-pushed the ALM-581 branch 9 times, most recently from 3e008a2 to 682d2ab Compare June 18, 2018 18:16
@alecmerdler
Copy link
Member Author

@ecordell The last test run passed, I just removed the TODOs, so this is ready for review.

Copy link
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

LGTM

@alecmerdler alecmerdler merged commit 251aa80 into operator-framework:master Jun 18, 2018
@alecmerdler alecmerdler deleted the ALM-581 branch June 18, 2018 20:16
njhale pushed a commit to njhale/operator-lifecycle-manager that referenced this pull request Sep 10, 2018
ecordell pushed a commit to ecordell/operator-lifecycle-manager that referenced this pull request Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal/tracked This issue is tracked in the internal JIRA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants