<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="1" skipped="6" tests="82" time="1359.141" timestamp="2026-11-03T13:51:19.619283+00:00" hostname="maas-group-test-psjqd-e2e-maas-openshift-pod"><testcase classname="tests.test_aitenant_lifecycle.TestAITenantRevocationOperandsSerial" name="test_aitenant_delete_completes_after_cleanup_serviceaccount_removed" time="31.212" /><testcase classname="tests.test_echo_large_io.TestEchoFidelity" name="test_response_mirrors_prompt" time="5.230" /><testcase classname="tests.test_echo_large_io.TestEchoFidelity" name="test_max_tokens_does_not_truncate" time="0.149" /><testcase classname="tests.test_echo_large_io.TestLargeIO" name="test_large_prompt_round_trips_unmodified" time="0.306" /><testcase classname="tests.test_echo_large_io.TestLargeIO" name="test_response_size_tracks_prompt_size" time="0.422" /><testcase classname="tests.test_echo_large_io.TestCredentialLeak" name="test_api_key_not_echoed_in_response" time="0.132" /><testcase classname="tests.test_echo_large_io.TestCredentialLeak" name="test_canary_in_prompt_is_not_leaked_to_headers" time="10.975" /><testcase classname="tests.test_embedding_inference.TestEmbeddingDefaultDeny" name="test_embedding_default_deny_403" time="0.258" /><testcase classname="tests.test_embedding_inference.TestEmbeddingPathRouting" name="test_embedding_path_based_200" time="5.172" /><testcase classname="tests.test_embedding_inference.TestEmbeddingPathRouting" name="test_embedding_bbr_llmisvc_200" time="0.425" /><testcase classname="tests.test_embedding_inference.TestEmbeddingGovernance" name="test_embedding_trlp_429" time="17.112" /><testcase classname="tests.test_embedding_inference.TestEmbeddingGovernance" name="test_embedding_with_governance_200" time="26.970" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_objective_created_and_status_ready" time="48.784" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_priority_update_propagates" time="0.676" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_manual_edit_is_reverted" time="0.569" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_gateway_authpolicy_sets_flow_control_headers" time="0.152" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_inference_with_spoofed_headers_succeeds" time="0.252" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_clearing_priority_deletes_objective" time="1.027" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_subscription_delete_removes_objective" time="13.070" /><testcase classname="tests.test_inference_priority.TestInferencePriorityWithoutScheduler" name="test_model_without_pool_is_not_applicable" time="14.006" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_explicit_subscription_header" time="1.789" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_models_filtered_by_subscription" time="1.456" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_different_modelrefs_same_model_id" time="46.775" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_empty_model_list" time="11.396" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_central_models_endpoint_exempt_from_rate_limiting" time="18.768" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_per_tenant_ipp_deployments_exist" time="76.573" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_per_tenant_ipp_env_vars" time="0.281"><skipped type="pytest.skip" message="praxis-extproc; Go IPP GATEWAY_NAME/TENANT_NAMESPACE env not applicable">/workspace/source/test/e2e/tests/test_per_tenant_ipp_isolation.py:235: praxis-extproc; Go IPP GATEWAY_NAME/TENANT_NAMESPACE env not applicable</skipped></testcase><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_per_tenant_envoyfilter_workload_selector_isolated" time="0.466" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_per_tenant_envoyfilter_grpc_clusters" time="0.285"><skipped type="pytest.skip" message="praxis-extproc; EnvoyFilter uses payload-*-extproc clusters (see test_per_tenant_praxis_isolation)">/workspace/source/test/e2e/tests/test_per_tenant_ipp_isolation.py:266: praxis-extproc; EnvoyFilter uses payload-*-extproc clusters (see test_per_tenant_praxis_isolation)</skipped></testcase><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_default_tenant_keeps_legacy_ipp_names" time="0.291" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_multiple_tenant_ipp_stacks_coexist" time="0.426" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPInfrastructure" name="test_per_tenant_networkpolicy_when_applied" time="0.292" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPRouting" name="test_default_gateway_hits_default_ipp_only" time="3.580" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPRouting" name="test_tenant_gateway_hits_tenant_ipp_only" time="35.642" /><testcase classname="tests.test_per_tenant_ipp_isolation.TestPerTenantIPPCleanup" name="test_ipp_resources_removed_on_aitenant_delete" time="81.134" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_pre_processing_rollout_recovers_inference" time="13.883" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_processing_rollout_recovers_inference" time="14.069" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_both_extproc_rollout_recovers_inference" time="14.610" /><testcase classname="tests.test_praxis_extproc_secret_rotation.TestPraxisExtProcSecretRotation" name="test_in_place_secret_rotation_keeps_egress_without_extproc_restart" time="107.384" /><testcase classname="tests.test_subscription.TestSubscriptionEnforcement" name="test_auth_pass_no_subscription_gets_403" time="1.220" /><testcase classname="tests.test_subscription.TestSubscriptionEnforcement" name="test_rate_limit_exhaustion_gets_429" time="14.505"><failure message="AssertionError: Got 429 on request #1 without any successful requests. This indicates a configuration issue, not rate limit exhaustion. Response: Too Many Requests&#10;  &#10;assert 0 &gt; 0">self = &lt;test_subscription.TestSubscriptionEnforcement object at 0x7fe638c81890&gt;

    @pytest.mark.serial
    def test_rate_limit_exhaustion_gets_429(self):
        """
        Test that a user gets 429 when they actually exceed their token rate limit.
    
        This test creates a dedicated subscription with a very low token limit,
        sends enough requests to exhaust it, and verifies a 429 response.
    
        Uses the unconfigured model to avoid interfering with other tests.
        """
        # Use unconfigured model to isolate this test
        model_ref = UNCONFIGURED_MODEL_REF
        model_path = UNCONFIGURED_MODEL_PATH
    
        # Create unique subscription and auth policy names
        auth_policy_name = "e2e-rate-limit-test-auth"
        subscription_name = "e2e-rate-limit-test-subscription"
    
        # Low limit so we exhaust it quickly. Actual tokens consumed per
        # response are non-deterministic (max_tokens is a ceiling, not exact),
        # so we send enough requests to be confident we hit the limit without
        # asserting exactly when the 429 arrives.
        token_limit = 10
        window = "1m"
        total_requests = 15
    
        try:
            # 1. Create auth policy allowing system:authenticated
            _create_test_auth_policy(
                name=auth_policy_name,
                model_refs=[model_ref],
                groups=["system:authenticated"]
            )
            _wait_for_maas_auth_policy_phase(auth_policy_name, require_enforced=False)
    
            # 2. Create subscription with low token limit
            _create_test_subscription(
                name=subscription_name,
                model_refs=[model_ref],
                groups=["system:authenticated"],
                token_limit=token_limit,
                window=window
            )
            _wait_for_subscription_inference_ready(
                subscription_name,
                model_ref,
                model_namespace=MODEL_NAMESPACE,
            )
    
            # 3. API key must be minted for this subscription
            oc_token = _get_cluster_token()
            api_key = _create_api_key(
                oc_token,
                name=f"e2e-rate-limit-{uuid.uuid4().hex[:8]}",
                subscription=subscription_name,
            )
    
            # 4. Send requests to exhaust the limit. Past the planned count keep
            # going until the enforcement deadline: the limiter can trail the
            # policy status, and this test asserts a 429, not a status field.
            rate_limited = False
            success_count = 0
            deadline = time.time() + RATE_LIMIT_ENFORCEMENT_TIMEOUT
    
            request_num = 0
            while request_num &lt; total_requests or time.time() &lt; deadline:
                request_num += 1
                r = _inference(api_key, path=model_path, max_tokens=1)
                log.info(f"Request {request_num}/{total_requests}: {r.status_code}")
    
                if r.status_code == 200:
                    success_count += 1
                elif r.status_code == 429:
                    rate_limited = True
                    log.info(f"Rate limit exceeded after {success_count} successful requests")
    
                    # Verify it's a rate limit 429, not a subscription error
                    response_text = r.text.lower() if r.text else ""
                    # Rate limit 429s typically mention "rate", "limit", or "quota"
                    # Subscription 429s mention "subscription" without "rate"
                    is_rate_limit_error = any(keyword in response_text
                                             for keyword in ["rate", "limit", "quota", "too many"])
                    is_subscription_error = "subscription" in response_text and not is_rate_limit_error
    
                    assert is_rate_limit_error or not is_subscription_error, \
                        f"Expected rate limit 429, not subscription error. Response: {r.text[:500]}"
    
                    # Check for Retry-After header (optional but good practice)
                    retry_after = r.headers.get("Retry-After") or r.headers.get("retry-after")
                    if retry_after:
                        log.info(f"Retry-After header present: {retry_after}")
    
                    break
                else:
                    # Unexpected status code
                    raise AssertionError(f"Unexpected status {r.status_code} at request {request_num}: {r.text[:200]}")
    
                # Brief pause to avoid overwhelming the system, but stay within the window
                time.sleep(0.1)
    
            # Verify we actually exhausted the limit (at least one successful request)
&gt;           assert success_count &gt; 0, \
                f"Got 429 on request #{request_num} without any successful requests. " \
                f"This indicates a configuration issue, not rate limit exhaustion. Response: {r.text[:500]}"
E               AssertionError: Got 429 on request #1 without any successful requests. This indicates a configuration issue, not rate limit exhaustion. Response: Too Many Requests
E                 
E               assert 0 &gt; 0

test/e2e/tests/test_subscription.py:720: AssertionError</failure></testcase><testcase classname="tests.test_subscription.TestMultipleSubscriptionsPerModel" name="test_user_in_one_of_two_subscriptions_gets_200" time="10.798" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_and_token_rate_limits_are_mutually_exclusive" time="0.584" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_key_is_not_rate_limited" time="11.706" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_subscriptions_share_one_wasm_limit" time="0.189"><skipped type="pytest.skip" message="no Kuadrant WasmPlugin for gateway maas-default-gateway">/workspace/source/test/e2e/tests/test_subscription.py:828: no Kuadrant WasmPlugin for gateway maas-default-gateway</skipped></testcase><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_usage_is_metered" time="25.300" /><testcase classname="tests.test_subscription.TestAllUnlimitedModel" name="test_all_unlimited_model_is_not_denied" time="20.216" /><testcase classname="tests.test_subscription.TestMultipleAuthPoliciesPerModel" name="test_two_auth_policies_or_logic" time="16.332" /><testcase classname="tests.test_subscription.TestMultipleAuthPoliciesPerModel" name="test_delete_one_auth_policy_other_still_works" time="1.202" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_delete_subscription_rebuilds_trlp" time="14.426" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_trlp_persists_during_multi_subscription_deletion" time="29.250" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_delete_last_subscription_denies_access" time="15.862" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_unconfigured_model_denied_by_gateway_auth" time="0.720" /><testcase classname="tests.test_subscription.TestRateLimitIdentityGenerations" name="test_legacy_and_short_identities_coexist" time="30.797" /><testcase classname="tests.test_subscription.TestManagedAnnotation" name="test_authpolicy_managed_false_prevents_update" time="0.322"><skipped type="pytest.skip" message="gateway-only mode: per-model AuthPolicy is not created">/workspace/source/test/e2e/tests/test_subscription.py:1615: gateway-only mode: per-model AuthPolicy is not created</skipped></testcase><testcase classname="tests.test_subscription.TestManagedAnnotation" name="test_trlp_managed_false_prevents_update" time="3.111" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_with_access_but_no_subscription_gets_403" time="15.916" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_single_subscription_auto_selects" time="122.091" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_group_based_auth_but_no_subscription_gets_403" time="15.485" /><testcase classname="tests.test_subscription.TestDegradedSubscriptionFiltering" name="test_failed_subscription_blocks_inference" time="17.109" /><testcase classname="tests.test_tenant.TestTenantLifecycle" name="test_payload_processing_deployed_with_active_tenant" time="7.290" /><testcase classname="tests.test_tenant.TestTenantLifecycle" name="test_payload_processing_and_pre_processing_resources" time="0.315"><skipped type="pytest.skip" message="default payload-processing is praxis-extproc; MaasTenantConfig.spec.payloadProcessing.resources is MaaS IPP-only">/workspace/source/test/e2e/tests/test_tenant.py:401: default payload-processing is praxis-extproc; MaasTenantConfig.spec.payloadProcessing.resources is MaaS IPP-only</skipped></testcase><testcase classname="tests.test_tenant_namespace_discovery.TestTenantNamespaceDiscovery" name="test_labeled_tenant_namespace_is_discovered" time="113.271" /><testcase classname="tests.test_tenant_namespace_discovery.TestTenantNamespaceDiscovery" name="test_dynamic_discovery_after_label_added" time="112.527" /><testcase classname="tests.test_tenant_namespace_discovery.TestTenantDiscoveryDormantMode" name="test_dormant_mode_ignores_labeled_namespace" time="0.001"><skipped type="pytest.skip" message="Dormant-mode test mutates controller flags; set ENABLE_TENANT_DISCOVERY_DORMANT_E2E=true">/workspace/source/test/e2e/tests/test_tenant_namespace_discovery.py:361: Dormant-mode test mutates controller flags; set ENABLE_TENANT_DISCOVERY_DORMANT_E2E=true</skipped></testcase><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[single-rate]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[two-rates]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[input-order-ignored]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[duplicates-collapse]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[window-not-normalized]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[sorted-as-strings]" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_single_member_predicate_is_unchanged" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_multi_member_predicate_is_sorted_or" time="0.001" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_same_rate_shares_limit_not_budget" time="43.361" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_users_on_same_subscription_are_independent" time="21.980" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_different_rates_get_separate_limits" time="36.463" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_rate_edit_moves_subscription_between_limits" time="42.696" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_x_api_key_authenticates" time="5.426" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_authorization_bearer_still_works" time="0.127" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_invalid_x_api_key_rejected" time="0.099" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_x_api_key_without_prefix_rejected" time="0.093" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_both_headers_no_conflict" time="0.836" /></testsuite></testsuites>