Handle connection closed in reconnect test

This commit is contained in:
Jakob Borg 2014-10-06 11:13:00 +02:00
parent 02bd1af293
commit 590afebc0a
1 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package integration_test
import (
"log"
"strings"
"sync"
"testing"
"time"
@ -82,6 +83,10 @@ func testRestartDuringTransfer(t *testing.T, restartSender, restartReceiver bool
for {
comp, err := sender.peerCompletion()
if err != nil {
if strings.Contains(err.Error(), "use of closed network connection") {
time.Sleep(250 * time.Millisecond)
continue
}
sender.stop()
receiver.stop()
t.Fatal(err)