Controlled polling interval without keepalives to avoid HTTP errors in integration test.

This commit is contained in:
Jakob Borg 2014-10-06 10:44:46 +02:00
parent 2fde82528d
commit 02bd1af293
3 changed files with 7 additions and 0 deletions

View File

@ -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 {

View File

@ -132,6 +132,8 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool
prevComp = curComp
}
time.Sleep(250 * time.Millisecond)
}
sender.stop()

View File

@ -99,6 +99,8 @@ loop:
}
}
}
time.Sleep(250 * time.Millisecond)
}
sender.stop()