-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
USHIFT-741: Microshift invariant adaptations #27647
Conversation
Skipping CI for Draft Pull Request. |
/cc @ingvagabund |
pkg/synthetictests/disruption.go
Outdated
@@ -33,6 +35,11 @@ func testServerAvailability( | |||
backendName := fmt.Sprintf("%s-%s-connections", disruptionName, connType) | |||
jobType, err := platformidentification.GetJobType(context.TODO(), restConfig) | |||
if err != nil { | |||
if apierrors.IsNotFound(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not found error can be in some cases a transitional error. I don't think testServerAvailability
takes that into account. Nevertheless, seeing platformidentification.GetJobType
as a black box, it's not safe to deduce non-existence of a certain API from a NotFoundErr. Worth considering a different approach or to refactore platformidentification.GetJobType
to provide more output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to be a bit more robust now. But could that happen? The tests only start after the cluster has been deemed ready, which means all resources and componentes are ready too: https://github.com/openshift/release/blob/master/ci-operator/step-registry/openshift/e2e/test/openshift-e2e-test-commands.sh#L294-L418
@@ -104,6 +93,19 @@ func testPodSandboxCreation(events monitorapi.Intervals, clientConfig *rest.Conf | |||
continue | |||
} | |||
if strings.Contains(event.Message, "pinging container registry") && strings.Contains(event.Message, "i/o timeout") { | |||
if platform == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform
will be always an empty string here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. It's populated at most once.
/retest-required |
1 similar comment
/retest-required |
pkg/synthetictests/alerts.go
Outdated
"github.com/openshift/origin/pkg/monitor/monitorapi" | ||
"github.com/openshift/origin/pkg/synthetictests/allowedalerts" | ||
) | ||
|
||
func testAlerts(events monitorapi.Intervals, restConfig *rest.Config, duration time.Duration, recordedResource *monitorapi.ResourcesMap) []*junitapi.JUnitTestCase { | ||
ret := []*junitapi.JUnitTestCase{} | ||
|
||
kubeClient, err := kubernetes.NewForConfig(restConfig) | ||
if err != nil { | ||
ret = append(ret, &junitapi.JUnitTestCase{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could return ret directly. I.e.
return []*junitapi.JUnitTestCase{
{
Name: "Alert setup, kube client",
FailureOutput: &junitapi.FailureOutput{
Output: err.Error(),
},
SystemOut: err.Error(),
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
pkg/synthetictests/disruption.go
Outdated
@@ -26,6 +26,22 @@ func testServerAvailability( | |||
|
|||
testName := fmt.Sprintf("[%s] %s should be available throughout the test", owner, locator) | |||
|
|||
skip, err := platformidentification.CanExtractPlatform(restConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/CanExtractPlatform/CanExtractJobType/ is more preferable. So it's clear why the check is done at the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is important as well. So it's more obvious for a reader who sees the code for the first time why we check this here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
} | ||
if !skip { | ||
return []*junitapi.JUnitTestCase{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return []*junitapi.JUnitTestCase{
{
Name: testName,
Duration: jobRunDuration.Seconds(),
FailureOutput: &junitapi.FailureOutput{
Output: fmt.Sprintf("skipping test due to missing API groups in either of clusterversions, infrastructures or networks groups"),
},
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized the name of the skip
variable is actually the opposite. Changed it.
@@ -104,6 +93,19 @@ func testPodSandboxCreation(events monitorapi.Intervals, clientConfig *rest.Conf | |||
continue | |||
} | |||
if strings.Contains(event.Message, "pinging container registry") && strings.Contains(event.Message, "i/o timeout") { | |||
if platform == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. It's populated at most once.
/retest-required |
pkg/synthetictests/alerts.go
Outdated
|
||
kubeClient, err := kubernetes.NewForConfig(restConfig) | ||
if err != nil { | ||
return &junitapi.JUnitTestCase{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be
return []*junitapi.JUnitTestCase{
{
Name: "Alert setup, kube client",
FailureOutput: &junitapi.FailureOutput{
Output: err.Error(),
},
SystemOut: err.Error(),
},
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, done.
/retest-required |
@pacevedom: The following tests failed, say
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. |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ingvagabund, pacevedom The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
if err != nil { | ||
return []*junitapi.JUnitTestCase{ | ||
{ | ||
Name: "Alert setup, kube client", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This results in an "only failed" test. it needs to set to "pass" in the majority of cases so that aggregation works properly. I'm surprised we don't have clients we can pass in here.
@@ -26,6 +26,22 @@ func testServerAvailability( | |||
|
|||
testName := fmt.Sprintf("[%s] %s should be available throughout the test", owner, locator) | |||
|
|||
canDetermineJobType, err := platformidentification.CanExtractJobType(restConfig) | |||
if err != nil { | |||
return []*junitapi.JUnitTestCase{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same "only failure" test here.
@@ -104,6 +93,19 @@ func testPodSandboxCreation(events monitorapi.Intervals, clientConfig *rest.Conf | |||
continue | |||
} | |||
if strings.Contains(event.Message, "pinging container registry") && strings.Contains(event.Message, "i/o timeout") { | |||
if platform == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(platform) == 0
is kube and openshift canonical
platform = infra.Status.PlatformStatus.Type | ||
} | ||
} | ||
} | ||
if platform == v1.AzurePlatformType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may be better off always failing if you cannot determine the platform, but this amounts to the same thing with a bad message if TRT can stomach the factorization.
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
PR needs rebase. 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. |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
/lifecycle frozen |
@chiragkyal: The In response to this:
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. |
/remove-lifecycle rotten |
Included in #28136 |
No description provided.