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:
Matthias Radestock committed 2015-05-29 14:17:03 +01:00
1 parent 3ad08c0f2a
commit 08a17ec376
2 files changed
-7

No files matched your search

-4
View File
@@ -68,8 +68,6 @@ func TestHttp(t *testing.T) {
alloc := makeAllocatorWithMockGossip(t, "08:00:27:01:c3:9a", testCIDR1, 1)
port := listenHTTP(alloc)
time.Sleep(100 * time.Millisecond) // Allow for http server to get going
alloc.claimRingForTesting()
// Ask the http server for a new address
cidr1 := HTTPPost(t, allocURL(port, containerID))
@@ -139,8 +137,6 @@ func impTestHTTPCancel(t *testing.T) {
alloc.claimRingForTesting()
port := listenHTTP(alloc)
time.Sleep(100 * time.Millisecond) // Allow for http server to get going
// Stop the alloc so nothing actually works
unpause := alloc.pause()
-3
View File
@@ -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])