no need for sleeps to wait for http server
Since we start the tcp listener in the main thread now, connections can be made immediately; they will just queue up until there is a handler.
This commit is contained in:
1 parent
3ad08c0f2a
commit
08a17ec376
2 files changed
-7
No files matched your search
@@ -7,7 +7,6 @@ import (
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
wt "github.com/weaveworks/weave/testing"
|
||||
)
|
||||
@@ -42,8 +41,6 @@ func TestHttp(t *testing.T) {
|
||||
port := httpListener.Addr().(*net.TCPAddr).Port
|
||||
go ServeHTTP(httpListener, "", nil, testDomain, zone)
|
||||
|
||||
time.Sleep(100 * time.Millisecond) // Allow for http server to get going
|
||||
|
||||
// Ask the http server to add our test address into the database
|
||||
addrParts := strings.Split(testAddr1, "/")
|
||||
addrURL := fmt.Sprintf("http://localhost:%d/name/%s/%s", port, containerID, addrParts[0])
|
||||
|
||||
Reference in new issue
Block a user