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.
[x] All 25 passed successfully for Test_CreateOrgVdcWithFlex.
[x] All 25 passed successfully for Test_VMPowerOnPowerOff.
This PR amends two tests:
Test_CreateOrgVdcWithFlex
It failed randomly with the following error:
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:
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
Where
$1
isTest_CreateOrgVdcWithFlex
(addGOVCD_SKIP_VAPP_CREATION=1
) andTest_VMPowerOnPowerOff
and$2
is25
.