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


##########
tests/gold_tests/dns/replay/connect_attempts_rr_down_server.replay.yaml:
##########
@@ -0,0 +1,165 @@
+#  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.
+
+#
+# This replay file assumes that caching is enabled.
+#
+
+meta:
+  version: "1.0"
+
+# Configuration section for autest integration
+autest:
+  description: 'Verify connect attempts behavior - retry down server'
+
+  dns:
+    name: 'dns-ds'
+    records: {"backend.example.com": ["0.0.0.1", "0.0.0.2"]}
+
+  server:
+    name: 'server-ds'
+
+  client:
+    name: 'client-ds'
+
+  ats:
+    name: 'ts-ds'
+    process_config:
+      enable_cache: false
+
+    records_config:
+      proxy.config.diags.debug.enabled: 1
+      proxy.config.diags.debug.tags: 'http|hostdb|dns'
+      proxy.config.http.connect_attempts_rr_retries: 0
+      proxy.config.http.connect_attempts_max_retries: 2
+      proxy.config.http.connect_attempts_max_retries_down_server: 1
+      proxy.config.http.connect_attempts_timeout: 30
+      proxy.config.http.down_server.cache_time: 5
+
+    remap_config:
+      - from: "http://example.com/";
+        to: "http://backend.example.com:{SERVER_HTTP_PORT}/";
+
+sessions:
+- transactions:
+  # try 0.0.0.1
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 1]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # try 0.0.0.2
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 2]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # retry on dead 0.0.0.1
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 3]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # retry on dead 0.0.0.2
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 4]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # request expected hit down_server cache and immidiately get 500

Review Comment:
   Typo in comment: `immidiately` should be `immediately`.
   ```suggestion
     # request expected hit down_server cache and immediately get 500
   ```



##########
tests/gold_tests/dns/replay/connect_attempts_rr_down_server.replay.yaml:
##########
@@ -0,0 +1,165 @@
+#  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.
+
+#
+# This replay file assumes that caching is enabled.
+#
+
+meta:
+  version: "1.0"
+
+# Configuration section for autest integration
+autest:
+  description: 'Verify connect attempts behavior - retry down server'
+
+  dns:
+    name: 'dns-ds'
+    records: {"backend.example.com": ["0.0.0.1", "0.0.0.2"]}
+
+  server:
+    name: 'server-ds'
+
+  client:
+    name: 'client-ds'
+
+  ats:
+    name: 'ts-ds'
+    process_config:
+      enable_cache: false
+
+    records_config:
+      proxy.config.diags.debug.enabled: 1
+      proxy.config.diags.debug.tags: 'http|hostdb|dns'
+      proxy.config.http.connect_attempts_rr_retries: 0
+      proxy.config.http.connect_attempts_max_retries: 2
+      proxy.config.http.connect_attempts_max_retries_down_server: 1
+      proxy.config.http.connect_attempts_timeout: 30
+      proxy.config.http.down_server.cache_time: 5
+
+    remap_config:
+      - from: "http://example.com/";
+        to: "http://backend.example.com:{SERVER_HTTP_PORT}/";
+
+sessions:
+- transactions:
+  # try 0.0.0.1
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 1]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # try 0.0.0.2
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 2]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # retry on dead 0.0.0.1
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 3]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # retry on dead 0.0.0.2
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 4]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 502
+
+  # request expected hit down_server cache and immidiately get 500
+  - client-request:
+      method: GET
+      url: /path/
+      version: '1.1'
+      headers:
+        fields:
+        - [Host, example.com]
+        - [uuid, 10]
+
+    # should not hit
+    server-response:
+      status: 200
+      reason: OK
+
+    proxy-response:
+      status: 500

Review Comment:
   This transaction expects a 500 response, but ATS's "origin down" path 
returns 502 (see `HttpTransact::OriginDown`), and with 
`proxy.config.http.connect_attempts_max_retries_down_server: 1` ATS will still 
attempt a connection to a marked-down origin rather than short-circuiting. The 
expected `proxy-response.status` here should be updated accordingly (likely 
502), and the accompanying comment should be adjusted to reflect what behavior 
is being asserted.



##########
tests/gold_tests/dns/replay/connect_attempts_rr_down_server.replay.yaml:
##########
@@ -0,0 +1,165 @@
+#  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.
+
+#
+# This replay file assumes that caching is enabled.

Review Comment:
   The header comment says this replay assumes caching is enabled, but 
`autest.ats.process_config.enable_cache` is set to `false`. Please 
update/remove the comment to match the actual configuration (or enable cache if 
that was intended).
   ```suggestion
   # This replay file runs with caching disabled.
   ```



-- 
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