To ensure that the HTTP Routing assertion times out in the appropriate time you will need to change the settings on the Connections tab so it looks like the image below.
Once you have done that you can use a branch to capture what the last audit value was and compare it against the standard output found for audit code 6005 and 9611 (Audit Detail Codes - CA API Gateway - 9.2 - CA Technologies Documentation ). I've included a sample policy to help get you started with the logic. As for your last question around which httpRouting.reasonCode will be returned it should be "-4 (Read timeout): One of packets being received from the URL took longer than the read timeout value to be received. The read timeout value is defined in the assertion properties." (Message Routing Context Variables - CA API Gateway - 9.2 - CA Technologies Documentation )
<?xml version="1.0" encoding="UTF-8"?>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
<wsp:OneOrMore wsp:Usage="Required">
<L7p:HttpRoutingAssertion>
<L7p:ConnectionTimeout stringValue="300"/>
<L7p:MaxRetries intValue="0"/>
<L7p:ProtectedServiceUrl stringValue="http://foo.ca.com/communities"/>
<L7p:ProxyPassword stringValueNull="null"/>
<L7p:ProxyUsername stringValueNull="null"/>
<L7p:RequestHeaderRules httpPassthroughRuleSet="included">
<L7p:ForwardAll booleanValue="true"/>
<L7p:Rules httpPassthroughRules="included">
<L7p:item httpPassthroughRule="included">
<L7p:Name stringValue="Cookie"/>
</L7p:item>
<L7p:item httpPassthroughRule="included">
<L7p:Name stringValue="SOAPAction"/>
</L7p:item>
</L7p:Rules>
</L7p:RequestHeaderRules>
<L7p:RequestParamRules httpPassthroughRuleSet="included">
<L7p:ForwardAll booleanValue="true"/>
<L7p:Rules httpPassthroughRules="included"/>
</L7p:RequestParamRules>
<L7p:ResponseHeaderRules httpPassthroughRuleSet="included">
<L7p:ForwardAll booleanValue="true"/>
<L7p:Rules httpPassthroughRules="included">
<L7p:item httpPassthroughRule="included">
<L7p:Name stringValue="Set-Cookie"/>
</L7p:item>
</L7p:Rules>
</L7p:ResponseHeaderRules>
<L7p:SamlAssertionVersion intValue="2"/>
<L7p:Timeout stringValue="5000"/>
</L7p:HttpRoutingAssertion>
<wsp:All wsp:Usage="Required">
<L7p:ComparisonAssertion>
<L7p:CaseSensitive booleanValue="false"/>
<L7p:Expression1 stringValue="${audit.details.last.fullText}"/>
<L7p:Operator operatorNull="null"/>
<L7p:Predicates predicates="included">
<L7p:item dataType="included">
<L7p:Type variableDataType="string"/>
</L7p:item>
<L7p:item binary="included">
<L7p:Operator operator="CONTAINS"/>
<L7p:RightValue stringValue="reply within the timeout"/>
</L7p:item>
</L7p:Predicates>
</L7p:ComparisonAssertion>
<L7p:HardcodedResponse>
<L7p:Base64ResponseBody stringValue="RmFpbHVyZQ=="/>
<L7p:ResponseContentType stringValue="text/plain; charset=UTF-8"/>
</L7p:HardcodedResponse>
</wsp:All>
</wsp:OneOrMore>
</wsp:All>
</wsp:Policy>
Sincerely,
Stephen Hughes
Director, CA Support