-
Task
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
False
-
-
False
-
subs-swatch-lightning
-
-
The sync_capacity method, if used for checking a change in value with the flag wait=True, is flawed in the best case scenario (from a capacity update timing perspective).
A pre-sync capacity is calculated. Then a retry mechanism check for value change after a sync.
If the SKU capacity is already added at the time of entering the method, then the new capacity is retrieved as pre_count.
That will lead the retry mechanism to check the new capacity for the SKU against an already updated value, thus being always post_count == pre_count .
That ends up running out of retries, wasting test run time for a condition that won't ever be true.
This can be fixed by passing a preemptively calculated pre_count value to the sync_capacity method. For example, to fix this behavior for the test test_validate_capacity_daily_on_openshift, "cores" and "sockets" values can be obtained from the true starting capacity stored in openshift_capacity_initial_daily_usage.
Acceptance Criteria:
- In case of capacity readily updated after SKU adding, the sync_capacity method don't use any attempt in checking for increment.
- The solution must be compliant to all the usage of the sync_capacity method.
- Don't change the valuable assertion of the existing tests impacted.
- The retry mechanism should be kept effective if the capacity update takes some time.