Fixing issue of failing test case in case of consecutive device delete
Change-Id: I3b43002587929b6c8840314b58e8e02b4b259efd
diff --git a/rw_core/core/api/grpc_nbi_handler_test.go b/rw_core/core/api/grpc_nbi_handler_test.go
index 8766c7c..ff6ff0b 100755
--- a/rw_core/core/api/grpc_nbi_handler_test.go
+++ b/rw_core/core/api/grpc_nbi_handler_test.go
@@ -544,7 +544,12 @@
//Ensure there are devices in the Core as delete was failed - wait until condition satisfied or timeout
var vFunction1 isDevicesConditionSatisfied = func(devices *voltha.Devices) bool {
- return devices != nil && len(devices.Items) == (nb.numONUPerOLT+1)
+ state, err := nbi.GetTransientState(getContext(), oltDevice.Id)
+ if err != nil {
+ return false
+ }
+ return devices != nil && len(devices.Items) == (nb.numONUPerOLT+1) &&
+ state == voltha.DeviceTransientState_DELETE_FAILED
}
err = waitUntilConditionForDevices(nb.maxTimeout, nbi, vFunction1)
assert.Nil(t, err)