<?xml version="1.0" encoding="UTF-8"?>
<t:test features="p:http-request"
        expected="fail" code="err:XC0078"
        xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xmlns:err="http://www.w3.org/ns/xproc-error">
   <t:info>
      <t:title>p:http-request 132 (NW)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-05-23</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added static options for web server host and port.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2024-12-26</t:date>
            <t:author>
               <t:name>Norman Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial commit.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Test timeout on p:http-request when fail-on-timeout is true.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step exclude-inline-prefixes="c xs"
                      version="3.0"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <p:output port="result"/>
         <p:option name="WHOST" select="'http://localhost:8246'" static="true"/>

         <p:http-request method="get"
                         href="{$WHOST}/service/slow"
                         parameters="map{'timeout': 2, 'fail-on-timeout': true()}">
            <p:with-input>
               <p:empty/>
            </p:with-input>
         </p:http-request>
         <p:identity>
            <p:with-input pipe="report"/>
         </p:identity>
      </p:declare-step>
   </t:pipeline>
</t:test>
