Browse Source

Handle connection closed in reconnect test

Jakob Borg 11 years ago
parent
commit
590afebc0a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      test/reconnect_test.go

+ 5 - 0
test/reconnect_test.go

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