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

Fix flaky test that sometimes fails due to leftover data from previous test runs

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • swatch-tally
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • subs-swatch-thunder

      The test test_validate_tally_on_public_cloud_with_sla is failing intermittently, causing pipeline failures and slowing down the development process.

      The test creates a cloud host with a specific SLA and verifies that the tally counts increase by exactly 1. However, it sometimes fails with an assertion error like assert 4 == (0 + 1), showing that the system is counting 4 sockets when we expected only 1.

      The test calls reset_account() at the beginning to clean up data, which successfully clears the tally database but doesn't clean up the Host Inventory service. When the test runs sync_tally(), it processes all hosts from the Host Inventory (including leftover hosts from previous tests), not just the newly created one.

      Recommended Solutions:
      1. Remove the reset_account() call and change assertion from == to >=
      2. Fix reset_account() to also clean Host Inventory
      3. Use unique identifiers or filters to isolate test data

      Acceptance Criteria

      • Fix the flaky test test_validate_tally_on_public_cloud_with_sla

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: