mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Controlled polling interval without keepalives to avoid HTTP errors in integration test.
This commit is contained in:
parent
2fde82528d
commit
02bd1af293
@ -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 {
|
||||
|
@ -132,6 +132,8 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool
|
||||
|
||||
prevComp = curComp
|
||||
}
|
||||
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
}
|
||||
|
||||
sender.stop()
|
||||
|
@ -99,6 +99,8 @@ loop:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
}
|
||||
|
||||
sender.stop()
|
||||
|
Loading…
Reference in New Issue
Block a user