Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4159

Avoid unnecessary waiting after adding SKU in e2e tests

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Automation
    • False
    • Hide

      None

      Show
      None
    • 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.

              Unassigned Unassigned
              rh-ee-tlencion Tommaso Lencioni
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: