<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/nw-step-timeout-002.xml"
        name="nw-step-timeout-002.xml"
        features="p:http-request timeout-support"
        expected="fail"
        code="err:XD0053">
   <t:info xmlns:err="http://www.w3.org/ns/xproc-error">
      <t:title>nw-step-timeout-002</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>
   <!-- I suppose one could argue for repeating this test for
        each compound step, but I'm assuming one's enough for now. -->
   <t:description xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:err="http://www.w3.org/ns/xproc-error">
      <p>Test step timeout on a compound step.</p>
   </t:description>
   <t:pipeline xmlns:err="http://www.w3.org/ns/xproc-error">
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      exclude-inline-prefixes="c xs"
                      version="3.0">
         <p:output port="result"/>
         <p:option name="WHOST" select="'http://localhost:8246'" static="true"/>
         <p:for-each timeout="2">
            <p:with-input>
               <doc/>
            </p:with-input>
            <p:http-request method="get" href="{$WHOST}/service/slow" assert="true()">
               <p:with-input>
                  <p:empty/>
               </p:with-input>
            </p:http-request>
            <!-- Nothing else should get run, but I can't think
              of an interoperable way to test that... -->
            <p:identity/>
         </p:for-each>
      </p:declare-step>
   </t:pipeline>
</t:test>
