Skip to content

Conversation

hickeng
Copy link
Contributor

@hickeng hickeng commented Jul 23, 2025

Description

This adds compound tests for whether a fault is a transient error. Variants of this test show up in various locations
in client code so pull into the library. This also doubles as a reference for what transient error conditions exist as
not all of the client tests detail all of these error types.

Additionally this adds a test for whether an InvalidPowerState error is due to the VM already being in the target state.
Checking this is a common pattern when trying to map desired state to imperative API.
This is specifically for PowerOff as I don't yet have a need for the others and didn't want to make the test generic to
the point that it takes a target powerstate as an argument, both to keep callers concise and to avoid a caller needing
to extract possible values from the enum.

How Has This Been Tested?

New unit test, all unit tests passed

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

@akutz
Copy link
Member

akutz commented Jul 24, 2025

Hey @hickeng,

You need to ensure one file is properly go fmt'd, and also, please use the --sign-off flag on your git commit. This is not about signing a commit, but signing off. It is confusingly named and different. See https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff.

This adds compound tests for whether a fault is a transient error, or
whether it's an error due to an attempt to power off an already powered
off VM.

The former is widely reimplemented by clients, and often missing some
types. The latter is extremely useful to have when mapping desired
state to imperative.

Signed-off-by: George Hicken <[email protected]>
@hickeng
Copy link
Contributor Author

hickeng commented Jul 24, 2025

Hey @hickeng,

You need to ensure one file is properly go fmt'd, and also, please use the --sign-off flag on your git commit. This is not about signing a commit, but signing off. It is confusingly named and different. See https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff.

Interesting - I have vscode set to run goimports on save so clearly I've got a tool version mismatch or something odd going on with language server.
Added signoff.

Copy link
Member

@akutz akutz left a comment

Choose a reason for hiding this comment

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

Thanks @hickeng !

@hickeng hickeng merged commit f12361c into vmware:main Jul 29, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants