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 test fire VMStorageClassWarning when rxbounce is disabled #1122

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

machadovilaca
Copy link
Member

What this PR does / why we need it:

Fix flaky test: [test_id:10549] Should fire VMStorageClassWarning when rxbounce is disabled

jira-ticket: https://issues.redhat.com/browse/CNV-47434

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Release note:

NONE

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Nov 6, 2024
Copy link
Contributor

@jcanocan jcanocan left a comment

Choose a reason for hiding this comment

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

Thanks! Nice work!

vm.Spec.Template.ObjectMeta.Annotations = map[string]string{
"vm.kubevirt.io/os": "windows-10",
}
vm.Spec.Running = ptr.To(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use RunStrategy instead?

Copy link
Member

Choose a reason for hiding this comment

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

+1 because there is a plan to deprecate vm.Spec.Running.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed

Copy link
Member Author

Choose a reason for hiding this comment

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

tests are failing because NewVirtualMachine is setting the vm.Spec.Running to false under the hood, and when I set the RunStrategy it errors with

Type: "FieldValueInvalid",
                          Message: "Running and RunStrategy are mutually exclusive",
                          Field: "spec.running",

@jcanocan @codingben

Copy link
Member Author

Choose a reason for hiding this comment

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

do I revert to use vm.Spec.Running for now until the NewVirtualMachine is also changed?

Copy link
Member Author

Choose a reason for hiding this comment

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

changed in NewVirtualMachine

- Running: &running,
+ RunStrategy: ptr.To(kubevirtv1.RunStrategyHalted),

var volumes []kubevirtv1.Volume

if createDataVolume {
createPVCAndPV(vmName, rxbounceEnabled)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove newline

Copy link
Member Author

Choose a reason for hiding this comment

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

removed

Comment on lines 253 to 254
var always = kubevirtv1.RunStrategyAlways
vm.Spec.RunStrategy = &always
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance to do this in a single line? E.g.,

vm.Spec.RunStrategy = ptr.To(kubevirtv1.RunStrategyAlways)

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@jcanocan
Copy link
Contributor

jcanocan commented Nov 7, 2024

Thanks @machadovilaca!
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2024
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2024
Copy link

sonarcloud bot commented Nov 7, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@machadovilaca
Copy link
Member Author

@jcanocan @codingben

@jcanocan
Copy link
Contributor

jcanocan commented Nov 8, 2024

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 8, 2024
@akrejcir
Copy link
Collaborator

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akrejcir

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2024
@kubevirt-bot kubevirt-bot merged commit 9c0734a into kubevirt:main Nov 11, 2024
12 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants