ywkaras commented on a change in pull request #8484:
URL: https://github.com/apache/trafficserver/pull/8484#discussion_r753485694



##########
File path: tests/gold_tests/proxy_protocol/proxy_serve_stale_dns_fail.test.py
##########
@@ -0,0 +1,79 @@
+'''
+Test proxy serving stale content when DNS lookup fails
+'''
+#  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.
+
+Test.ContinueOnFail = True
+# Set up hierarchical caching processes
+ts_child = Test.MakeATSProcess("ts_child")
+ts_parent = Test.MakeATSProcess("ts_parent")
+server_name = "http://unknown.domain.com/";
+
+Test.testName = "STALE"
+
+# Config child proxy to route to parent proxy
+ts_child.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 30,
+    'proxy.config.http.parent_proxy.self_detect': 0,
+})
+ts_child.Disk.parent_config.AddLine(
+    f'dest_domain=. parent=localhost:{ts_parent.Variables.port} 
round_robin=consistent_hash go_direct=false'
+)
+ts_child.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_child.Variables.port} {server_name}'
+)
+
+# Configure parent proxy
+ts_parent.Disk.records_config.update({
+    'proxy.config.url_remap.pristine_host_hdr': 1,
+    'proxy.config.http.cache.max_stale_age': 30,
+})
+ts_parent.Disk.remap_config.AddLine(
+    f'map http://localhost:{ts_parent.Variables.port} {server_name}'
+)
+ts_parent.Disk.remap_config.AddLine(
+    f'map {server_name} {server_name}'
+)
+
+# Object to push to proxies
+stale_5 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: 
bytes\nContent-Length: 6\nCache-Control: public, max-age=5\n\nCACHED"
+stale_30 = "HTTP/1.1 200 OK\nServer: ATS/10.0.0\nAccept-Ranges: 
bytes\nContent-Length: 6\nCache-Control: public, max-age=30\n\nCACHED"

Review comment:
       Could this be changed to max-age=10 (or other value less than 30)?  
@zwoop may only give you a fruit cake for X-mas if you make Au regression test 
runs take 30 seconds longer.




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