mirror of
				https://git.haproxy.org/git/haproxy.git/
				synced 2025-10-31 08:30:59 +01:00 
			
		
		
		
	With the CI occasionally slowing down, we're starting to see again some spurious failures despite the long 1-second timeouts. This reports false positives that are disturbing and doesn't provide as much value as this could. However at this delay it already becomes a pain for developers to wait for the tests to complete. This commit adds support for the new environment variable HAPROXY_TEST_TIMEOUT that will allow anyone to modify the connect, client and server timeouts. It was set to 5 seconds by default, which should be plenty for quite some time in the CI. All relevant values that were 200ms or above were replaced by this one. A few larger values were left as they are special. One test for the set-timeout action that used to rely on a fixed 1-sec value was extended to a fixed 5-sec, as the timeout is normally not reached, but it needs to be known to compare the old and new values.
		
			
				
	
	
		
			62 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| varnishtest "Test declaration of TCP rules in default sections"
 | |
| 
 | |
| feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.5-dev0)'"
 | |
| feature ignore_unknown_macro
 | |
| 
 | |
| server s1 {
 | |
|         rxreq
 | |
|         txresp
 | |
|         expect req.http.x-test1-frt == "def_front"
 | |
|         expect req.http.x-test1-bck == "def_back"
 | |
| }  -start
 | |
| 
 | |
| haproxy h1 -conf {
 | |
|   defaults common
 | |
|       mode http
 | |
|       timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
 | |
|       timeout client  "${HAPROXY_TEST_TIMEOUT-5s}"
 | |
|       timeout server  "${HAPROXY_TEST_TIMEOUT-5s}"
 | |
| 
 | |
|   defaults def_front from common
 | |
|       tcp-request connection accept
 | |
|       tcp-request session accept
 | |
|       tcp-request inspect-delay 5s
 | |
|       tcp-request content set-var(txn.test1) "str(def_front)"
 | |
|       tcp-request content accept
 | |
| 
 | |
|   defaults def_back from common
 | |
|       tcp-request inspect-delay 5s
 | |
|       tcp-request content set-var(txn.test1) "str(def_back)"
 | |
|       tcp-request content accept
 | |
| 
 | |
|       tcp-response inspect-delay 5s
 | |
|       tcp-response content set-var(txn.test2) "str(def_back)"
 | |
|       tcp-response content accept
 | |
| 
 | |
|   frontend fe from def_front
 | |
|       bind "fd@${feh1}"
 | |
|       tcp-request connection reject
 | |
|       tcp-request session reject
 | |
|       tcp-request content reject
 | |
| 
 | |
|       http-request set-header x-test1-frt "%[var(txn.test1)]"
 | |
| 
 | |
|       default_backend be
 | |
| 
 | |
|   backend be from def_back
 | |
|       tcp-response content reject
 | |
| 
 | |
|       http-request set-header x-test1-bck "%[var(txn.test1)]"
 | |
|       http-response set-header x-test2 "%[var(txn.test2)]"
 | |
| 
 | |
|       server s1 ${s1_addr}:${s1_port}
 | |
| 
 | |
| } -start
 | |
| 
 | |
| client c1 -connect ${h1_feh1_sock} {
 | |
|         txreq -req GET -url /
 | |
|         rxresp
 | |
|         expect resp.status == 200
 | |
|         expect resp.http.x-test2 == "def_back"
 | |
| } -run
 |