Browse Source

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

Jakob Borg 11 years ago
parent
commit
02bd1af293
3 changed files with 7 additions and 0 deletions
  1. 3 0
      test/common_test.go
  2. 2 0
      test/reconnect_test.go
  3. 2 0
      test/transfer-bench_test.go

+ 3 - 0
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 {

+ 2 - 0
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()

+ 2 - 0
test/transfer-bench_test.go

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