From 02bd1af293bc262d03087d71310589e0a963e3e6 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 6 Oct 2014 10:44:46 +0200 Subject: [PATCH] Controlled polling interval without keepalives to avoid HTTP errors in integration test. --- test/common_test.go | 3 +++ test/reconnect_test.go | 2 ++ test/transfer-bench_test.go | 2 ++ 3 files changed, 7 insertions(+) diff --git a/test/common_test.go b/test/common_test.go index 5aeaf5fd7..c846cb58a 100644 --- a/test/common_test.go +++ b/test/common_test.go @@ -99,6 +99,9 @@ func (p *syncthingProcess) stop() { func (p *syncthingProcess) get(path string) (*http.Response, error) { client := &http.Client{ Timeout: 2 * time.Second, + Transport: &http.Transport{ + DisableKeepAlives: true, + }, } req, err := http.NewRequest("GET", fmt.Sprintf("http://127.0.0.1:%d%s", p.port, path), nil) if err != nil { diff --git a/test/reconnect_test.go b/test/reconnect_test.go index b1f65498e..21ec8c32d 100644 --- a/test/reconnect_test.go +++ b/test/reconnect_test.go @@ -132,6 +132,8 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool prevComp = curComp } + + time.Sleep(250 * time.Millisecond) } sender.stop() diff --git a/test/transfer-bench_test.go b/test/transfer-bench_test.go index 55d47618f..ee6735c31 100644 --- a/test/transfer-bench_test.go +++ b/test/transfer-bench_test.go @@ -99,6 +99,8 @@ loop: } } } + + time.Sleep(250 * time.Millisecond) } sender.stop()