Copilot commented on code in PR #13391:
URL: https://github.com/apache/trafficserver/pull/13391#discussion_r3591364394


##########
tests/gold_tests/cache/replay/alternate-caching-quality.yaml:
##########
@@ -0,0 +1,142 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+meta:
+  version: "1.0"
+
+autest:
+  description: 'Verify TSHttpAltInfoQualitySet affects alternate selection'
+
+  dns:
+    name: 'dns_alt_quality'
+
+  server:
+    name: 'server_alt_quality'
+
+  client:
+    name: 'client_alt_quality'
+
+  ats:
+    name: 'ts_alt_quality'
+    process_config:
+      enable_cache: true
+
+    records_config:
+      proxy.config.cache.select_alternate: 1
+      proxy.config.cache.limits.http.max_alts: 4
+      proxy.config.http.cache.ignore_query: 1
+
+    plugin_config:
+      - "xdebug.so --enable=x-cache"
+
+    remap_config:
+      - from: "http://example.com/";
+        to: "http://backend.example.com:{SERVER_HTTP_PORT}/";
+
+sessions:
+- transactions:
+  # Store the English response as the first alternate.
+  - all: { headers: { fields: [[ uuid, 1 ]]}}
+    client-request:
+      method: "GET"
+      version: "1.1"
+      scheme: "http"
+      url: /path/request?variant=English
+      delay: 100ms
+      headers:
+        fields:
+        - [ Host, example.com ]
+        - [ Accept-Language, English ]
+        - [ X-Debug, X-Cache ]
+
+    server-response:
+      status: 200
+      reason: OK
+      headers:
+        fields:
+        - [ Content-Length, 0 ]
+        - [ Cache-Control, max-age=60 ]
+        - [ Content-Language, English ]
+        - [ X-Response-Variant, English ]
+
+    proxy-response:
+      status: 200
+      headers:
+        fields:
+        - [ X-Response-Variant, { value: English, as: equal } ]
+        - [ X-Cache, { value: miss, as: equal } ]
+
+  # The plugin rejects the English alternate because its query differs,
+  # allowing the French response to be stored as another alternate.

Review Comment:
   The comment says the plugin rejects the English alternate because its query 
differs, but TSHttpAltInfoQualitySet only scales the match quality and is 
clamped to [0..1]; it can’t force a miss by itself. In this replay, the 
miss/store for the French transaction is driven by the core 
Accept-Language/Content-Language matching, not the query mismatch, so this 
comment is misleading for anyone debugging the test.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to