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

OCPBUGS-29594: e2e: fix comparing incompatible types #957

Merged
merged 2 commits into from Feb 16, 2024

Conversation

mrniranjan
Copy link
Contributor

This patch fixes comparing incompatible types,
profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)

Instead of using pointer.Bool, directly compare the boolean value.

This patch fixes comparing incompatible types,
profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)

Instead of using pointer.Bool, directly compare the boolean
value.

Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
Copy link
Contributor

@jmencak jmencak left a comment

Choose a reason for hiding this comment

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

/approve

@@ -84,7 +84,7 @@ var _ = Describe("[rfe_id:49062][workloadHints] Telco friendly workload specific
By("Modifying profile")
profile.Spec.WorkloadHints = nil

if profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false) {
if *profile.Spec.RealTimeKernel.Enabled != true {
Copy link
Contributor

@jmencak jmencak Feb 15, 2024

Choose a reason for hiding this comment

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

So I'm assuming we want to skip the test when

*profile.Spec.RealTimeKernel.Enabled == false 

right? Would it be a bit more readable? Similarly below. Also, do we need any checks for nil pointer dereference here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right == false would have made more readable. updating the patch

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

openshift-ci bot commented Feb 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jmencak, mrniranjan

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2024
Signed-off-by: Niranjan M.R <mrniranjan@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 15, 2024
@jmencak
Copy link
Contributor

jmencak commented Feb 15, 2024

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen:
/lgtm

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

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: /lgtm

@jmencak If for some reason profile is nil, it will fail very early in the test.

@jmencak
Copy link
Contributor

jmencak commented Feb 15, 2024

The only concern I have is a potential null-pointer dereference, but if you're sure this cannot happen: /lgtm

@jmencak If for some reason profile is nil, it will fail very early in the test.

I'm not worried about profile == nil. Can profile.Spec.RealTimeKernel be nil though?

func main() {
        var profile PerformanceProfile

        fmt.Printf("PoC=%v\n", profile.Spec.RealTimeKernel.Enabled)
}

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x47c75e]

goroutine 1 [running]:
main.main()
        /home/mencak/work/programs/golang/mine/index/index.go:229 +0x3e

@jmencak
Copy link
Contributor

jmencak commented Feb 15, 2024

/hold
please unhold when we're sure this cannot happen ^

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 15, 2024
@mrniranjan
Copy link
Contributor Author

mrniranjan commented Feb 16, 2024

@jmencak

Profile.Spec.RealTimeKernel cannot be nil because , realTimeKernel attribute of Performance Profile is a mandatory field to be given, It take 2 values true or false. without which Profile cannot be applied

@mrniranjan mrniranjan changed the title e2e: fix comparing incompatible types OCPBUGS-29594: e2e: fix comparing incompatible types Feb 16, 2024
@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. labels Feb 16, 2024
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This patch fixes comparing incompatible types,
profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)

Instead of using pointer.Bool, directly compare the boolean value.

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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Feb 16, 2024
@mrniranjan
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link
Contributor

@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

@mrniranjan
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 16, 2024
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: This pull request references Jira Issue OCPBUGS-29594, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @gsr-shanks

In response to this:

/jira refresh

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.

@jmencak
Copy link
Contributor

jmencak commented Feb 16, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 16, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD d7c3111 and 2 for PR HEAD 1ae4a14 in total

Copy link
Contributor

openshift-ci bot commented Feb 16, 2024

@mrniranjan: 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 abfe492 into openshift:master Feb 16, 2024
15 checks passed
@openshift-ci-robot
Copy link
Contributor

@mrniranjan: Jira Issue OCPBUGS-29594: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-29594 has not been moved to the MODIFIED state.

In response to this:

This patch fixes comparing incompatible types,
profile.Spec.RealTimeKernel.Enabled == pointer.Bool(false)

Instead of using pointer.Bool, directly compare the boolean value.

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-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build cluster-node-tuning-operator-container-v4.16.0-202402161440.p0.gabfe492.assembly.stream.el9 for distgit cluster-node-tuning-operator.
All builds following this will include this PR.

@mrniranjan
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@mrniranjan: #957 failed to apply on top of branch "release-4.15":

Applying: e2e: fix comparing incompatible types
Using index info to reconstruct a base tree...
M	test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
Falling back to patching base and 3-way merge...
Auto-merging test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
CONFLICT (content): Merge conflict in test/e2e/performanceprofile/functests/8_performance_workloadhints/workloadhints.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 e2e: fix comparing incompatible types
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.15

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.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-03-23-173230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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

6 participants