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 quirks in Test_CreateOrgVdcWithFlex and Test_VMPowerOnPowerOff #538

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Jan 9, 2023

This PR amends two tests:

Test_CreateOrgVdcWithFlex

It failed randomly with the following error:

START: adminvdc_test.go:24: TestVCD.Test_CreateOrgVdcWithFlex
adminvdc_test.go:150:
    check.Assert(*vdcStorageProfileDetails.Enabled, Equals, false)
... obtained bool = true
... expected bool = false

FAIL: adminvdc_test.go:24: TestVCD.Test_CreateOrgVdcWithFlex

I could reproduce this issue several times, then it started to pass without any change. Given that the variable vdcStorageProfileDetails was being retrieved from a fixed index from an array, my assumption is that it failed due to the array being unordered.

I could not demonstrate this hypothesis but I changed the test implementation to use a loop to avoid the situation if that's the case. It should make the test more robust anyway.

Test_VMPowerOnPowerOff

Thanks to @Didainius for fixing this one.

This one failed randomly with the following error:

START: vm_test.go:666: TestVCD.Test_VMPowerOnPowerOff
vm_test.go:683:
    check.Assert(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"error powering off VM: API Error: 400: [ 714a562e-1f6b-4e06-8ba5-621564803be1 ] The requested operation could not be executed since VM \"My-vm\" is not powered on."} ("error powering off VM: API Error: 400: [ 714a562e-1f6b-4e06-8ba5-621564803be1 ] The requested operation could not be executed since VM \"My-vm\" is not powered on.")

FAIL: vm_test.go:666: TestVCD.Test_VMPowerOnPowerOff

Due to the underlying VCD not being as fast as expected in powering off the VM, it could be in state "Powering off".

Tests done

Just a simple

  for i in {1..$2}
  do
    echo "####### Iteration $i"
    go test -tags functional -check.vv -check.f $1 -timeout=120m .
  done 

Where $1 is Test_CreateOrgVdcWithFlex (add GOVCD_SKIP_VAPP_CREATION=1) and Test_VMPowerOnPowerOff and $2 is 25.

  • All 25 passed successfully for Test_CreateOrgVdcWithFlex.
  • All 25 passed successfully for Test_VMPowerOnPowerOff.

abarreiro added 2 commits January 9, 2023 10:46
@adambarreiro adambarreiro self-assigned this Jan 9, 2023
abarreiro added 2 commits January 9, 2023 11:16
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro marked this pull request as ready for review January 9, 2023 10:34
@adambarreiro adambarreiro changed the title Fix quirks in Test_CreateOrgVdcWithFlex Fix quirks in Test_CreateOrgVdcWithFlex and Test_VMPowerOnPowerOff Jan 9, 2023
@adambarreiro adambarreiro merged commit 032f154 into vmware:main Jan 9, 2023
@adambarreiro adambarreiro deleted the amend-test-quirks branch January 9, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants