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

Investigate and fix test_verify_rhel_els_addon_payg_sync tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • None
    • None
    • Automation
    • 5
    • False
    • Hide

      None

      Show
      None
    • False

      These are all failing for the same reasons:

       

      Ibutsu: https://ibutsu.insights.corp.redhat.com/project/3915c900-85fc-1222-833c-10d51af56f2e/runs/84bdb65a-f0f4-4d95-b156-6780fb4108c2#classify-failures

       

      Trace Log:

      application = <iqe.base.application.Application object at 0x7f077b428bf0>
      sync_functions = [<function sync_hourly at 0x7f0780630b80>, <function sync_nightly at 0x7f0780630c20>]
      event_sources = ([<function create_hbi_host at 0x7f0780630cc0>, <function create_metered_host at 0x7f0780630d60>], ['rhel-for-x86-els-unconverted', 'rhel-for-x86-els-payg-addon'])    @pytest.mark.post_stage_deploy
          @pytest.mark.parametrize(
              "sync_functions", [([sync_hourly, sync_nightly]), ([sync_nightly, sync_hourly])]
          )
          @pytest.mark.parametrize(
              "event_sources",
              [
                  (
                      [create_hbi_host, create_metered_host],
                      ["rhel-for-x86-els-unconverted", "rhel-for-x86-els-payg-addon"],
                  ),
                  (
                      [create_metered_host, create_hbi_host],
                      ["rhel-for-x86-els-payg-addon", "rhel-for-x86-els-unconverted"],
                  ),
              ],
          )
          def test_verify_rhel_els_payg_addon_sync_order(application, sync_functions, event_sources):
              """Test to verify creating host in different orders for rhel-els-payg-addon product with different sync orders.
              metadata:
                  assignee: aunayak
                  negative: false
                  importance: high
                  requirements: payg_tally
                  test_steps:
                      1. Create host using first event source.
                      2. Sync tally hourly or nightly based on sync_order.
                      3. Ensure tally pass.
                      4. Sync tally hourly or nightly based on sync_order.
                      5. Host should be visible in rhel-for-els-unconverted if HBI host, rhel-els-payg-addon if rhelmeter host.
                      6. Create same host using second event source.
                      7. Sync tally nightly.
                      8. Verify host details for rhel-els-payg-addon if HBI host, rhel-for-els-unconverted if rhelmeter host.
                  expected_results:
                      1. Host is created successfully.
                      2. Hourly or nightly tally sync is successful.
                      3. Host is visible in appropriate product after nightly sync.
                      4. Verification passes after nightly sync.
              """
              event_source_funcs, product_ids = event_sources
          
              # Step 1: Create host using first event source
              host, instance_uuid = event_source_funcs[0](application, product_ids[0])
          
              # Step 2: First sync (hourly or nightly)
              sync_functions[0](application, product_ids[0], host)
          
              # Step 4: Second sync (hourly or nightly)
              sync_functions[1](application, product_ids[0], host)
          
              # Step 5: Verify host is visible in the appropriate product
              verify_host(application, product_ids[0], instance_uuid)
          
              # Step 6: Create same host using second event source
              host, instance_uuid = event_source_funcs[1](application, product_ids[1], instance_uuid)
          
              # Step 7: Sync tally
              sync_functions[1](application, product_ids[1], host)
          
              sync_functions[0](application, product_ids[1], host)
          
              # Step 8: Verify host not present in other product other than product1,product2 and RHEL for X86
      >       verify_host(
                  application,
                  product_ids[1],
                  instance_uuid,
                  excluded_products=[product_ids[0], product_ids[1], "RHEL for x86"],
              )/iqe_venv/lib/python3.12/site-packages/iqe_rhsm_subscriptions/tests/integration/swatch_tally/test_tally_dedup_rhel_els.py:173: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ application = <iqe.base.application.Application object at 0x7f077b428bf0>
      product_id = 'rhel-for-x86-els-payg-addon', instance_uuid = 'test9295'
      excluded_products = ['rhel-for-x86-els-unconverted', 'rhel-for-x86-els-payg-addon', 'RHEL for x86']    def verify_host(application, product_id, instance_uuid, excluded_products=None):
              """Verify host details."""
          
              # Check the host in the specified product_id
              host = application.rhsm_subscriptions.search_system_table(
                  product_id=product_id, display_name_contains=instance_uuid
              )
      >       assert host, f"{host} not found in system table for product id {product_id}"
      E       AssertionError: False not found in system table for product id rhel-for-x86-els-payg-addon
      E       assert False/iqe_venv/lib/python3.12/site-packages/iqe_rhsm_subscriptions/tests/integration/swatch_tally/test_tally_dedup_rhel_els.py:96: AssertionError 

      IQE Log:

      Using random seed value for random generation: 8289 Creating a aws host with extra facts:{} {     "name": "test9295",     "serviceLevel": "premium",     "role": null,     "usage": "production",     "facts": {         "cpu.core(s)_per_socket": 1,         "cpu.cpu_socket(s)": 1,         "memory.memtotal": 96,         "network.hostname": "test9295",         "network.fqdn": "test9295",         "system.certificate_version": "3.0",         "uname.machine": "x86_64",         "virt.is_guest": true,         "insights_id": "57fbca03-5859-4a2a-b0c7-68ec432daa6d",         "dmi.system.version": "4.11.amazon",         "dmi.bios.version": "4.11.amazon",         "aws_account_id": "6035343500835675999",         "aws_instance_id": "test9295"     },     "lastCheckin": "2025-06-10T14:46:19.575484Z",     "installedProducts": [         {             "created": "2025-06-10T14:46:19.575Z",             "updated": "2025-06-10T14:46:19.575Z",             "startDate": "2025-06-10T14:46:19.575Z",             "endDate": "2025-06-25T14:46:19.575Z",             "productId": "69",             "productName": "RHEL for x86",             "arch": "x86_64"         },         {             "created": "2025-06-10T14:46:19.576Z",             "updated": "2025-06-10T14:46:19.576Z",             "startDate": "2025-06-10T14:46:19.576Z",             "endDate": "2025-06-25T14:46:19.576Z",             "productId": "204",             "productName": "rhel-for-x86-els-converted",             "arch": "x86_64"         }     ],     "type": {         "id": "0",         "label": "system",         "manifest": false     } } Request response url: https://admin.rhsm.stage.redhat.com/candlepin/consumers?identity_cert_creation=true&owner=18939574, status_code: 200 Host created:---- {'display_name': 'test9295', 'hardware_type': 'CLOUD', 'sockets': '1', 'subscription_manager_id': '640e228b-a64a-44ca-a032-1ed224712baa', 'measurement_type': 'aws', 'cloud_provider': 'aws'} POST request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/tally/hourly?org=18939574&start=2025-06-10T11%3A00%3A00Z&end=2025-06-10T18%3A00%3A00Z, status_code: 204 Trace log using : 00-de9c9f4eb8839932fe7b5afd4591b7bb-cfb9c71f151f03dc-01 Not valid JSON output. Returning plain text message. Tally synced from 2025-06-10T11:00:00Z to 2025-06-10T18:00:00Z. POST request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-conduit/internal/api/rhsm-subscriptions/v1/internal/rpc/syncOrg, status_code: 200 Trace log using : 00-ac837def24bc93e6a9be9ad4b5000aad-7e0cd90c83aec5a0-00 REST: GET https://console.stage.redhat.com/api/inventory/v1/hosts with query params [('display_name', 'test9295'), ('page', 1)] and x-rh-insights-request-id=d14f207afc0047b7a5a522cc05e6345e Waiting for conduit sync completion... REST: GET https://console.stage.redhat.com/api/inventory/v1/hosts with query params [('display_name', 'test9295'), ('page', 1)] and x-rh-insights-request-id=b011e9759fd64803958cb28ed62943a1 RHSM-conduit sync finished successfully! REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-unconverted with query params [] and x-rh-insights-request-id=64dcf6b2b6144893b479407759b86f73 Total Hosts in rhel-for-x86-els-unconverted system table: 91 PUT request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/rpc/tally/snapshots/18939574, status_code: 200 Trace log using : 00-371b7f31c81bf37cf6788a0d8b16d741-0b465491cfdaeeb7-01 REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-unconverted with query params [] and x-rh-insights-request-id=e3d86c2581804aee8f67851984d73a63 Total Hosts in rhel-for-x86-els-unconverted system table: 92 REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-unconverted with query params [('limit', 100), ('offset', 0), ('display_name_contains', 'test9295')] and x-rh-insights-request-id=33c3b27b85a54b3d937f2e2d79f37f36 [{'id': '4f1d37a3-9bd2-4ba3-bfaa-05c7a76379d8', 'instance_id': 'test9295', 'display_name': 'test9295', 'measurements': [1.0], 'last_seen': datetime.datetime(2025, 6, 10, 14, 46, 22, 897239, tzinfo=tzlocal()), 'number_of_guests': 0, 'category': 'cloud', 'cloud_provider': 'aws', 'subscription_manager_id': '640e228b-a64a-44ca-a032-1ed224712baa', 'inventory_id': '402304f4-a662-44eb-ae00-16262445a078', '_labeled_measurements': {'Sockets': 1.0}}] Tally Sync Finished Successfully! REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-unconverted with query params [('limit', 100), ('offset', 0), ('display_name_contains', 'test9295')] and x-rh-insights-request-id=0a6af9c62fde4bb0aa63e465a125caa0 [{'id': '4f1d37a3-9bd2-4ba3-bfaa-05c7a76379d8', 'instance_id': 'test9295', 'display_name': 'test9295', 'measurements': [1.0], 'last_seen': datetime.datetime(2025, 6, 10, 14, 46, 22, 897239, tzinfo=tzlocal()), 'number_of_guests': 0, 'category': 'cloud', 'cloud_provider': 'aws', 'subscription_manager_id': '640e228b-a64a-44ca-a032-1ed224712baa', 'inventory_id': '402304f4-a662-44eb-ae00-16262445a078', '_labeled_measurements': {'Sockets': 1.0}}]{'id': '4f1d37a3-9bd2-4ba3-bfaa-05c7a76379d8', 'instance_id': 'test9295', 'display_name': 'test9295', 'measurements': [1.0], 'last_seen': datetime.datetime(2025, 6, 10, 14, 46, 22, 897239, tzinfo=tzlocal()), 'number_of_guests': 0, 'category': 'cloud', 'cloud_provider': 'aws', 'subscription_manager_id': '640e228b-a64a-44ca-a032-1ed224712baa', 'inventory_id': '402304f4-a662-44eb-ae00-16262445a078', '_labeled_measurements': {'Sockets': 1.0}} found in system table for product id rhel-for-x86-els-unconverted Adding payg events of org 18939574 ... POST request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/rpc/tally/events, status_code: 200 Trace log using : 00-24dfc571f319f1d0b12b1a18feca70b0-dd955285d4fca007-00 GET request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/rpc/tally/events/18939574?begin=2025-06-10T13%3A00%3A00Z&end=2025-06-10T14%3A00%3A00Z, status_code: 200 Trace log using : 00-428e5522f7c06ff63b29ce883dd5a23d-b68931d58dbcc85b-00 Found events after saving: [     {         "billing_account_id": "test129",         "billing_provider": "aws",         "conversion": true,         "display_name": "automation__cluster_i-YQdFryZtXE",         "event_id": "0b38d060-631c-4643-9987-e31e1e1f7350",         "event_source": "rhelemeter",         "event_type": "vCPUs",         "expiration": "2025-06-10T14:00:00Z",         "instance_id": "i-YQdFryZtXE",         "isHypervisor": false,         "isUnmappedGuest": false,         "isVirtual": false,         "measurements": [             {                 "metric_id": "vCPUs",                 "value": 1.0             }         ],         "org_id": "18939574",         "product_ids": [             "204"         ],         "product_tag": [             "rhel-for-x86-els-payg"         ],         "record_date": "2025-06-10T14:45:57.063244826Z",         "service_type": "RHEL System",         "sla": "Premium",         "timestamp": "2025-06-10T13:00:00Z"     },     {         "billing_account_id": "test;test9295",         "billing_provider": "aws",         "conversion": false,         "display_name": "automation__cluster_test9295",         "event_id": "48dabedd-059b-4ca1-a0ff-5d3d016264c8",         "event_source": "rhelemeter",         "event_type": "vCPUs",         "expiration": "2025-06-10T14:00:00Z",         "instance_id": "test9295",         "isHypervisor": false,         "isUnmappedGuest": false,         "isVirtual": false,         "measurements": [             {                 "metric_id": "vCPUs",                 "value": 1.0             }         ],         "org_id": "18939574",         "product_ids": [             "204"         ],         "product_tag": [             "rhel-for-x86-els-payg-addon"         ],         "record_date": "2025-06-10T14:46:33.526280919Z",         "service_type": "RHEL System",         "sla": "Premium",         "timestamp": "2025-06-10T13:00:00Z"     } ] [{'event_source': 'rhelemeter', 'event_type': 'vCPUs', 'org_id': '18939574', 'instance_id': 'test9295', 'timestamp': '2025-06-10T13:00:00Z', 'expiration': '2025-06-10T14:00:00Z', 'display_name': 'automation__cluster_test9295', 'measurements': [{'value': 1, 'metric_id': 'vCPUs'}], 'sla': 'Premium', 'service_type': 'RHEL System', 'product_ids': ['204'], 'billing_provider': 'aws', 'billing_account_id': 'test;test9295'}] rhel-for-x86-els-payg-addon PAYG Cluster test9295 created successfully!! REST: GET https://console.stage.redhat.com/api/inventory/v1/hosts with query params [] and x-rh-insights-request-id=b9b0f89e081047ffa64e6908526c7221 Total Hosts in inventory: 1279 POST request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-conduit/internal/api/rhsm-subscriptions/v1/internal/rpc/syncOrg, status_code: 200 Trace log using : 00-08f57d41a3ac34b50b4b3f11899edbb1-64c13c53d442238e-01 REST: GET https://console.stage.redhat.com/api/inventory/v1/hosts with query params [] and x-rh-insights-request-id=4e2f9c6092384bc28662b22ba038f6aa Total Hosts in inventory: 1279 Waiting for conduit sync completion... REST: GET https://console.stage.redhat.com/api/inventory/v1/hosts with query params [] and x-rh-insights-request-id=8a54de51d28c4e2b8a4ca565cf41c020 Total Hosts in inventory: 1279 REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [] and x-rh-insights-request-id=4faedf60f334442dae2da99cf90c5759 Total Hosts in rhel-for-x86-els-payg-addon system table: 0 PUT request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/rpc/tally/snapshots/18939574, status_code: 200 Trace log using : 00-ef9b273e063f0cee8eefcaab2ddd4e2d-b2a1dd4735c36f77-00 REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [] and x-rh-insights-request-id=144b196a34924a7eb104aa08c3bdda22 Total Hosts in rhel-for-x86-els-payg-addon system table: 0 Retrying tally for org 18939574... PUT request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/rpc/tally/snapshots/18939574, status_code: 200 Trace log using : 00-6475e5964291f99c5a04653a05cf1b72-ac288e8f78140ce3-00 Waiting for tally sync completion... REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [] and x-rh-insights-request-id=d0a2e4c2505044f6bede56bb1d401f62 Total Hosts in rhel-for-x86-els-payg-addon system table: 0 Tally Sync Finished Successfully! POST request response url: https://mtls.internal.cloud.stage.redhat.com/app/rhsm-worker/internal/api/rhsm-subscriptions/v1/internal/tally/hourly?org=18939574&start=2025-06-10T11%3A00%3A00Z&end=2025-06-10T18%3A00%3A00Z, status_code: 204 Trace log using : 00-1839d3052d6c0dd216e834739e558f87-210c911e6298a093-00 Not valid JSON output. Returning plain text message. Tally synced from 2025-06-10T11:00:00Z to 2025-06-10T18:00:00Z. REST: GET https://console.stage.redhat.com/api/rhsm-subscriptions/v1/instances/products/rhel-for-x86-els-payg-addon with query params [('limit', 100), ('offset', 0), ('display_name_contains', 'test9295')] and x-rh-insights-request-id=4cffc6391c844d57a9be6db8ec17208b
      

              rh-ee-liwalker Lisa Walker
              rhn-sqe-tmcknigh Trayvon McKnight
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: