浏览代码

test cases: wait 100 milliseconds before recheck if the test server is up

this avoid a lot of useless warnings in travis logs
Nicola Murino 6 年之前
父节点
当前提交
7360b0f73c
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      api/api_test.go
  2. 1 0
      sftpd/sftpd_test.go

+ 1 - 0
api/api_test.go

@@ -101,6 +101,7 @@ func waitTCPListening(address string) {
 		conn, err := net.Dial("tcp", address)
 		if err != nil {
 			fmt.Printf("tcp server %v not listening: %v\n", address, err)
+			time.Sleep(100 * time.Millisecond)
 			continue
 		}
 		fmt.Printf("tcp server %v now listening\n", address)

+ 1 - 0
sftpd/sftpd_test.go

@@ -140,6 +140,7 @@ func waitTCPListening(address string) {
 		conn, err := net.Dial("tcp", address)
 		if err != nil {
 			fmt.Printf("tcp server %v not listening: %v\n", address, err)
+			time.Sleep(100 * time.Millisecond)
 			continue
 		}
 		fmt.Printf("tcp server %v now listening\n", address)