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

Fix flaky event recording config-policy-controller E2E test #174

Merged

Conversation

yiraeChristineKim
Copy link
Contributor

@yiraeChristineKim yiraeChristineKim commented Nov 6, 2023

Comment on lines 60 to 63
Eventually(func() []v1.Event {
return utils.GetMatchingEvents(clientManaged, testNamespace,
case15AlwaysCompliantName, "", "Policy status is NonCompliant", defaultTimeoutSeconds)
}, defaultTimeoutSeconds, 1).Should(BeEmpty())
Copy link
Member

Choose a reason for hiding this comment

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

(Optional) Do we want this to be Consistently()? If not, I don't think it needs to be wrapped in Eventually() since it's checking whether it's empty.

@@ -482,7 +482,7 @@ var _ = Describe("Test templatization", Ordered, func() {
case13PruneTmpErr+"-configmap", "default", true, defaultTimeoutSeconds)

return configmap
}, defaultTimeoutSeconds, 1).ShouldNot(BeNil())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

consistently timeout

Copy link
Member

Choose a reason for hiding this comment

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

What do you mean?

I think this change is good - we don't need to check that the configmap is still there for 60 (or more) seconds, 30 should be fine. But I don't understand why it would be timing out right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't any issue but I tried to reduce e2e test time. I think 60 secs is meaningless. Just suggestion. It took over 20mins before but now less than 15 mins

@@ -219,7 +219,7 @@ var _ = Describe("Test Object deletion", Ordered, func() {
case20PodName, "default", true, defaultTimeoutSeconds)

return pod
}, defaultTimeoutSeconds, 1).Should(Not(BeNil()))
}, 30, 1).Should(Not(BeNil()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

consistently timeout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

10-12 mins now

@@ -106,7 +106,7 @@ var _ = BeforeSuite(func() {
clientManagedDynamic = NewKubeClientDynamic("", kubeconfigManaged, "")
defaultImageRegistry = "quay.io/open-cluster-management"
testNamespace = "managed"
defaultTimeoutSeconds = 60
defaultTimeoutSeconds = 100
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Increase this timeout because minimum version is slow

Copy link
Member

Choose a reason for hiding this comment

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

@yiraeChristineKim is it only specific tests that fail without this increased default timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now 60 sec works fine

@yiraeChristineKim yiraeChristineKim marked this pull request as ready for review November 9, 2023 18:38
@@ -482,7 +482,7 @@ var _ = Describe("Test templatization", Ordered, func() {
case13PruneTmpErr+"-configmap", "default", true, defaultTimeoutSeconds)

return configmap
}, defaultTimeoutSeconds, 1).ShouldNot(BeNil())
Copy link
Member

Choose a reason for hiding this comment

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

What do you mean?

I think this change is good - we don't need to check that the configmap is still there for 60 (or more) seconds, 30 should be fine. But I don't understand why it would be timing out right now?

test/e2e/case20_delete_objects_test.go Outdated Show resolved Hide resolved
Signed-off-by: Yi Rae Kim <yikim@redhat.com>
gvrPolicy schema.GroupVersionResource
testNamespace string
defaultTimeoutSeconds int
defaultConsistentlyDuration int
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this only

@@ -21,7 +21,7 @@ const (
case5ComboYaml string = "../resources/case5_multi/case5_multi_combo.yaml"
)

var _ = Describe("Test multiple obj template handling", func() {
var _ = Describe("Test multiple obj template handling", Ordered, func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This caused minimum version issue

Signed-off-by: Yi Rae Kim <yikim@redhat.com>
Copy link

openshift-ci bot commented Nov 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JustinKuli, yiraeChristineKim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JustinKuli,yiraeChristineKim]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 30d1181 into open-cluster-management-io:main Nov 13, 2023
4 checks passed
@@ -73,7 +73,7 @@ var _ = Describe("Test an objectDefinition with an invalid field", Ordered, func
}

return startTime.After(compPlcEvents[len(compPlcEvents)-1].LastTimestamp.Time)
}, defaultTimeoutSeconds, 1).Should(BeTrue())
}, 30, 1).Should(BeTrue())
Copy link
Member

Choose a reason for hiding this comment

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

@yiraeChristineKim did you forget to update this value and the other value in this file to use the new global variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I missed these 2 Thanks Let me open pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants