From b3e245007778f17fc7103be3ad7eb3558707261c Mon Sep 17 00:00:00 2001 From: Jusshersmith Date: Thu, 23 May 2019 17:26:54 +0100 Subject: [PATCH] add test for flush interval vs timeout logic --- internal/proxy/reverse_proxy_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/proxy/reverse_proxy_test.go b/internal/proxy/reverse_proxy_test.go index 76f115c4..a7ce3c86 100644 --- a/internal/proxy/reverse_proxy_test.go +++ b/internal/proxy/reverse_proxy_test.go @@ -484,6 +484,16 @@ func TestTimeoutHandler(t *testing.T) { ExpectedStatusCode: 200, ExpectedBody: "OK", }, + { + name: "does not time out because flush interval is set", + config: &UpstreamConfig{ + Timeout: time.Duration(100) * time.Millisecond, + FlushInterval: time.Duration(10) * time.Millisecond, + }, + globalTimeout: time.Duration(100) * time.Millisecond, + ExpectedStatusCode: 200, + ExpectedBody: "OK", + }, { name: "times out using upstream config timeout", config: &UpstreamConfig{