Refactor integration tests to be a little cleaner and more stable, I hope

This commit is contained in:
Jakob Borg
2015-05-23 22:56:43 +02:00
parent e215cf6fb8
commit 9463192224
10 changed files with 145 additions and 317 deletions

View File

@@ -13,7 +13,6 @@ import (
"encoding/json"
"log"
"testing"
"time"
"github.com/syncthing/protocol"
"github.com/syncthing/syncthing/internal/config"
@@ -92,19 +91,9 @@ func TestManyPeers(t *testing.T) {
}
defer sender.stop()
for {
comp, err := sender.peerCompletion()
if err != nil {
if isTimeout(err) {
time.Sleep(250 * time.Millisecond)
continue
}
t.Fatal(err)
}
if comp[id2] == 100 {
return
}
time.Sleep(2 * time.Second)
err = awaitCompletion("default", sender, receiver)
if err != nil {
t.Fatal(err)
}
log.Println("Comparing directories...")