<?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="1" skipped="12" tests="85" time="1774.103" timestamp="2026-11-03T15:06:00.823652+00:00" hostname="maas-group-test-fr4l8-e2e-maas-openshift-pod"><testcase classname="tests.test_aitenant_lifecycle.TestAITenantRevocationOperandsSerial" name="test_aitenant_delete_completes_after_cleanup_serviceaccount_removed" time="63.490" /><testcase classname="tests.test_api_keys.TestAPIKeySubscriptionPhases" name="test_create_key_for_pending_subscription" time="38.726" /><testcase classname="tests.test_api_keys.TestAPIKeySubscriptionPhases" name="test_reject_key_for_unreconciled_subscription" time="17.744" /><testcase classname="tests.test_crd_watch_resilience.TestDynamicCRDWatch" name="test_controller_stable_without_kserve_crd" time="0.000"><skipped type="pytest.skip" message="requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in">/workspace/source/test/e2e/tests/test_crd_watch_resilience.py:224: requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in</skipped></testcase><testcase classname="tests.test_crd_watch_resilience.TestDynamicCRDWatch" name="test_dynamic_watch_fires_exactly_once_on_crd_install" time="0.000"><skipped type="pytest.skip" message="requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in">/workspace/source/test/e2e/tests/test_crd_watch_resilience.py:262: requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in</skipped></testcase><testcase classname="tests.test_crd_watch_resilience.TestDynamicCRDWatch" name="test_static_watch_registered_when_crd_present_at_startup" time="0.000"><skipped type="pytest.skip" message="requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in">/workspace/source/test/e2e/tests/test_crd_watch_resilience.py:312: requires a disposable cluster: deletes the cluster-scoped KServe CRD; set E2E_RUN_CRD_WATCH_RESILIENCE=true to opt in</skipped></testcase><testcase classname="tests.test_echo_large_io.TestEchoFidelity" name="test_response_mirrors_prompt" time="15.352" /><testcase classname="tests.test_echo_large_io.TestEchoFidelity" name="test_max_tokens_does_not_truncate" time="0.324" /><testcase classname="tests.test_echo_large_io.TestLargeIO" name="test_large_prompt_round_trips_unmodified" time="0.808" /><testcase classname="tests.test_echo_large_io.TestLargeIO" name="test_response_size_tracks_prompt_size" time="0.961" /><testcase classname="tests.test_echo_large_io.TestCredentialLeak" name="test_api_key_not_echoed_in_response" time="0.279" /><testcase classname="tests.test_echo_large_io.TestCredentialLeak" name="test_canary_in_prompt_is_not_leaked_to_headers" time="12.086" /><testcase classname="tests.test_embedding_inference.TestEmbeddingDefaultDeny" name="test_embedding_default_deny_403" time="0.512" /><testcase classname="tests.test_embedding_inference.TestEmbeddingPathRouting" name="test_embedding_path_based_200" time="8.884" /><testcase classname="tests.test_embedding_inference.TestEmbeddingPathRouting" name="test_embedding_bbr_llmisvc_200" time="0.723" /><testcase classname="tests.test_embedding_inference.TestEmbeddingGovernance" name="test_embedding_trlp_429" time="23.944" /><testcase classname="tests.test_embedding_inference.TestEmbeddingGovernance" name="test_embedding_with_governance_200" time="31.322" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_objective_created_and_status_ready" time="57.940" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_priority_update_propagates" time="0.882" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_manual_edit_is_reverted" time="0.711" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_gateway_authpolicy_sets_flow_control_headers" time="0.174" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_inference_with_spoofed_headers_succeeds" time="0.521" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_clearing_priority_deletes_objective" time="3.471" /><testcase classname="tests.test_inference_priority.TestInferencePriority" name="test_subscription_delete_removes_objective" time="14.793" /><testcase classname="tests.test_inference_priority.TestInferencePriorityWithoutScheduler" name="test_model_without_pool_is_not_applicable" time="16.510" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_single_subscription_auto_select" time="136.117" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_explicit_subscription_header" time="1.684" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_models_filtered_by_subscription" time="2.105" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_different_modelrefs_same_model_id" time="100.822" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_empty_model_list" time="15.048" /><testcase classname="tests.test_models_endpoint.TestModelsEndpoint" name="test_central_models_endpoint_exempt_from_rate_limiting" time="31.904" /><testcase classname="tests.test_negative_security.TestAuthPolicyRemoval" name="test_authpolicy_deletion_revokes_access" time="3.699" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_pre_processing_rollout_recovers_inference" time="14.941" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_processing_rollout_recovers_inference" time="16.181" /><testcase classname="tests.test_praxis_extproc_restart.TestPraxisExtProcRestart" name="test_both_extproc_rollout_recovers_inference" time="15.802" /><testcase classname="tests.test_praxis_extproc_secret_rotation.TestPraxisExtProcSecretRotation" name="test_in_place_secret_rotation_keeps_egress_without_extproc_restart" time="122.084" /><testcase classname="tests.test_subscription.TestSubscriptionEnforcement" name="test_auth_pass_no_subscription_gets_403" time="4.070" /><testcase classname="tests.test_subscription.TestSubscriptionEnforcement" name="test_rate_limit_exhaustion_gets_429" time="21.011"><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 0x7f02ac85e450&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.TestSubscriptionEnforcement" name="test_models_endpoint_exempt_from_rate_limiting" time="26.243" /><testcase classname="tests.test_subscription.TestMultipleSubscriptionsPerModel" name="test_user_in_one_of_two_subscriptions_gets_200" time="11.882" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_and_token_rate_limits_are_mutually_exclusive" time="0.653" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_key_is_not_rate_limited" time="19.860" /><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_subscriptions_share_one_wasm_limit" time="0.163"><skipped type="pytest.skip" message="no Kuadrant WasmPlugin for gateway maas-default-gateway">/workspace/source/test/e2e/tests/test_subscription.py:961: no Kuadrant WasmPlugin for gateway maas-default-gateway</skipped></testcase><testcase classname="tests.test_subscription.TestUnlimitedSubscription" name="test_unlimited_usage_is_metered" time="26.915" /><testcase classname="tests.test_subscription.TestAllUnlimitedModel" name="test_all_unlimited_model_is_not_denied" time="37.557" /><testcase classname="tests.test_subscription.TestMultipleAuthPoliciesPerModel" name="test_two_auth_policies_or_logic" time="21.932" /><testcase classname="tests.test_subscription.TestMultipleAuthPoliciesPerModel" name="test_delete_one_auth_policy_other_still_works" time="3.683" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_delete_subscription_rebuilds_trlp" time="17.165" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_trlp_persists_during_multi_subscription_deletion" time="34.871" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_delete_last_subscription_denies_access" time="20.754" /><testcase classname="tests.test_subscription.TestCascadeDeletion" name="test_unconfigured_model_denied_by_gateway_auth" time="0.893" /><testcase classname="tests.test_subscription.TestRateLimitIdentityGenerations" name="test_legacy_and_short_identities_coexist" time="40.907" /><testcase classname="tests.test_subscription.TestManagedAnnotation" name="test_authpolicy_managed_false_prevents_update" time="0.356"><skipped type="pytest.skip" message="gateway-only mode: per-model AuthPolicy is not created">/workspace/source/test/e2e/tests/test_subscription.py:1748: 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.275" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_with_access_but_no_subscription_gets_403" time="18.362" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_single_subscription_auto_selects" time="167.985" /><testcase classname="tests.test_subscription.TestE2ESubscriptionFlow" name="test_e2e_group_based_auth_but_no_subscription_gets_403" time="16.990" /><testcase classname="tests.test_subscription.TestStatusReporting" name="test_subscription_degraded_trlp_blocks_inference" time="102.896" /><testcase classname="tests.test_subscription.TestDegradedSubscriptionFiltering" name="test_failed_subscription_blocks_inference" time="23.468" /><testcase classname="tests.test_tenant.TestTenantLifecycle" name="test_payload_processing_deployed_with_active_tenant" time="7.147" /><testcase classname="tests.test_tenant.TestTenantLifecycle" name="test_payload_processing_and_pre_processing_resources" time="0.301"><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_external_model_compat.TestLegacyIppCoexistence" name="test_no_route_on_default_gateway" time="0.000"><skipped type="pytest.skip" message="legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable">/workspace/source/test/e2e/tests/test_tenant_external_model_compat.py:377: legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable</skipped></testcase><testcase classname="tests.test_tenant_external_model_compat.TestLegacyIppCoexistence" name="test_not_served_through_default_gateway" time="0.000"><skipped type="pytest.skip" message="legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable">/workspace/source/test/e2e/tests/test_tenant_external_model_compat.py:386: legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable</skipped></testcase><testcase classname="tests.test_tenant_external_model_compat.TestLegacyIppCoexistence" name="test_no_ipp_status_writes" time="0.000"><skipped type="pytest.skip" message="legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable">/workspace/source/test/e2e/tests/test_tenant_external_model_compat.py:401: legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable</skipped></testcase><testcase classname="tests.test_tenant_external_model_compat.TestLegacyIppCoexistence" name="test_shared_provider_ownership_stays_defined" time="0.000"><skipped type="pytest.skip" message="legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable">/workspace/source/test/e2e/tests/test_tenant_external_model_compat.py:411: legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable</skipped></testcase><testcase classname="tests.test_tenant_external_model_compat.TestLegacyIppCoexistence" name="test_agc_tenant_gateway_still_serves" time="0.000"><skipped type="pytest.skip" message="legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable">/workspace/source/test/e2e/tests/test_tenant_external_model_compat.py:425: legacy IPP coexistence E2E requires the MaaS IPP image pin containing the legacy-controller exclusion guard; set TENANT_EXTERNAL_MODEL_LEGACY_IPP_E2E=true to enable</skipped></testcase><testcase classname="tests.test_tenant_namespace_discovery.TestTenantDiscoveryDormantMode" name="test_dormant_mode_ignores_labeled_namespace" time="0.496"><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:359: 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.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[input-order-ignored]" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[duplicates-collapse]" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[window-not-normalized]" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_limit_name[sorted-as-strings]" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_single_member_predicate_is_unchanged" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestExpectedShapeHelpers" name="test_multi_member_predicate_is_sorted_or" time="0.000" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_same_rate_shares_limit_not_budget" time="41.217" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_users_on_same_subscription_are_independent" time="36.658" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_different_rates_get_separate_limits" time="52.350" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_rate_edit_moves_subscription_between_limits" time="53.772" /><testcase classname="tests.test_trlp_rate_grouping.TestRateGrouping" name="test_gateway_wasm_config_grows_by_clause_not_limit" time="169.607" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_x_api_key_authenticates" time="11.533" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_authorization_bearer_still_works" time="0.358" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_invalid_x_api_key_rejected" time="0.255" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_x_api_key_without_prefix_rejected" time="0.229" /><testcase classname="tests.test_x_api_key_auth.TestXAPIKeyAuthentication" name="test_both_headers_no_conflict" time="6.241" /></testsuite></testsuites>