Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proxy: fix flaky TestSlowService (#2528)
backendTimeout("1ms") in TestSlowService may cancel context during dialing which results in `i/o timeout` error and 502 response status ``` $ go test ./proxy -run=TestSlowService -count=10000 | grep -F 'FAIL:' -C1 ... time="2023-08-18T20:50:57+02:00" level=error msg="error while proxying after 1.295026ms, route with backend network http://127.0.0.1:38613, status code 502: dialing failed true: failed to do backend roundtrip to 127.0.0.1:38613: dial tcp 127.0.0.1:38613: i/o timeout, remote host: 127.0.0.1, request: \"GET / HTTP/1.1\", host: 127.0.0.1:36801, user agent: \"Go-http-client/1.1\"" --- FAIL: TestSlowService (0.00s) backendtimeout_test.go:40: expected 504, got: &{502 Bad Gateway 502 HTTP/1.1 1 1 map[Content-Length:[12] Content-Type:[text/plain; charset=utf-8] Date:[Fri, 18 Aug 2023 18:50:57 GMT] Server:[Skipper] X-Content-Type-Options:[nosniff]] 0xc00068e100 12 [] false false map[] 0xc000255600 <nil>} ``` Increase TestSlowService filter parameter to 10ms. Also make requests using test proxy client. Signed-off-by: Alexander Yastrebov <[email protected]>
- Loading branch information