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

TRT-1452: Separate excessive Back-off restarting tests via namespace #28543

Conversation

DennisPeriquet
Copy link
Contributor

This introduces NamespacedTest() which can be used where the Test() method is used if we want to split out more pathological tests by namespace.

To test, we need this test to fail on multiple namespaces:

[sig-cluster-lifecycle] pathological event should not see excessive Back-off restarting failed containers

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 23, 2024

@DennisPeriquet: This pull request references TRT-1452 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

This introduces NamespacedTest() which can be used where the Test() method is used if we want to split out more pathological tests by namespace.

To test, we need this test to fail on multiple namespaces:

[sig-cluster-lifecycle] pathological event should not see excessive Back-off restarting failed containers

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 23, 2024
@openshift-ci openshift-ci bot requested review from csrwng and mfojtik January 23, 2024 22:33
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 23, 2024
@DennisPeriquet
Copy link
Contributor Author

/test e2e-agnostic-ovn-cmd

// Find the junit with the namespace of openshift-etcd-operator int the testname
var testJunits []*junitapi.JUnitTestCase
for _, j := range junits {
if strings.Contains(j.Name, "openshift-etcd-operator") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably better to pass in the namespace you want to find as part of the tests struct in case there is a want / need to test for other namespaces later on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that makes sense. thx

})
// Add a success for flakes
if len(result.failures) == 0 && len(result.flakes) > 0 {
if len(result.failures) == 0 && len(result.flakes) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious about this change, generateFailureOutput looks like it returns an empty string if no flakes or failures, did you see failures recorded when there weren't any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it returns a "" which means that when we create the JUnitTestCase in https://github.com/openshift/origin/blob/a4f1e13bbff4eb91494779f68ad5e0414449eb5b/pkg/monitortestlibrary/pathologicaleventlibrary/duplicated_events.go#L148C1-L153C7, we end up with a FailureOutput which results in a failed JUnitTestCase as noted in my first set of test runs including this job. This is why I have the line at 145 to create a success JUnitTestCase where the FailureOutput will be nil. This way, the test will show as a success.

@DennisPeriquet
Copy link
Contributor Author

/test verify
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade

@DennisPeriquet
Copy link
Contributor Author

/test e2e-gcp-ovn-rt-upgrade

}
}

for ns, result := range nsResults {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if you can do it without double processing the loop, initializing all namespaces then removing the empty ones

If you had a function like below could you call
nsResults[namespace] = addEventResult(nsResults[namespace], fmt.Sprintf("event [%s] happened %d times", msg, times), true)

etc.

func addEventResult(nsResult *eventResult{}, msg string, flake bool) *eventResult {
if nsResult == nil {
nsResult = &eventResult{}
}

if flake {
nsResult.flakes = append(nsResult.flakes, msg)
} else {
nsResult.failures = append(nsResult.failures, msg)
}
return nsResult

}

Copy link
Contributor

Choose a reason for hiding this comment

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

That snippet won't work as is, you would probably have to pass in the map and the namespace and then do the check in the function. Just doesn't feel right initializing it all and then removing the empty ones..

if _, ok := nsResults[namespace]; !ok {
tmp := &eventResult{}
nsResults[namespace] = tmp
}

Copy link
Contributor

Choose a reason for hiding this comment

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

addEventResult_function.txt

wonder if this patch would do it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just doesn't feel right initializing it all and then removing the empty ones.

Good instinct.

I pushed a commit that will track only namespaces with failures or flakes so that we only traverse the loop once.

@DennisPeriquet
Copy link
Contributor Author

/test e2e-gcp-ovn-upgrade
/test e2e-gcp-ovn

// Find the junit with the namespace of openshift-etcd-operator int the testname
var testJunits []*junitapi.JUnitTestCase
for _, j := range junits {
if strings.Contains(j.Name, namespace) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here what I was thinking was the test would have namespace: "openshift-etcd-operator" and the logic would be

if strings.Contains(j.Name, tt.namespace)

Then if the test was updated later on to test another namespace it would handle it.

But no need to hold this up for that, if / when there is a need it is easy enough to refactor.

@neisw
Copy link
Contributor

neisw commented Jan 26, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2024
Copy link
Contributor

openshift-ci bot commented Jan 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DennisPeriquet, neisw

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:

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

@DennisPeriquet
Copy link
Contributor Author

/test e2e-gcp-ovn-rt-upgrade
/test e2e-gcp-csi
/test e2e-aws-csi

@DennisPeriquet
Copy link
Contributor Author

/test e2e-aws-ovn-single-node
/test e2e-aws-ovn-single-node-upgrade

@DennisPeriquet
Copy link
Contributor Author

/label acknowledge-critical-fixes

Copy link
Contributor

openshift-ci bot commented Jan 31, 2024

@DennisPeriquet: The label(s) /label acknowledge-critical-fixes cannot be applied. These labels are supported: acknowledge-critical-fixes-only, platform/aws, platform/azure, platform/baremetal, platform/google, platform/libvirt, platform/openstack, ga, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, px-approved, docs-approved, qe-approved, no-qe, downstream-change-needed, rebase/manual, cluster-config-api-changed, approved, backport-risk-assessed, bugzilla/valid-bug, cherry-pick-approved, jira/valid-bug, staff-eng-approved. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to this:

/label acknowledge-critical-fixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@DennisPeriquet
Copy link
Contributor Author

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jan 31, 2024
@DennisPeriquet
Copy link
Contributor Author

FYI: I'm not saying this is a critical fix; I'm only trying to add enough label so this PR can get merged. This PR predates the enactment of the acknowledge-critical-fixes so it should not matter.

@jmguzik
Copy link

jmguzik commented Jan 31, 2024

/retest-required

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ea8b512 and 2 for PR HEAD 44bf785 in total

Copy link
Contributor

openshift-ci bot commented Feb 1, 2024

@DennisPeriquet: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit f533902 into openshift:master Feb 1, 2024
19 of 22 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-enterprise-tests-container-v4.16.0-202402011041.p0.gf533902.assembly.stream for distgit openshift-enterprise-tests.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants