diff --git a/server/server.go b/server/server.go index 38f1bc2..f3777ad 100644 --- a/server/server.go +++ b/server/server.go @@ -21,11 +21,11 @@ var ErrServerAlreadyRunning = fmt.Errorf("server is already running") type Server struct { baseCtx context.Context + listener net.Listener mutex *sync.Mutex handler *http.Server addr string channels []wasabi.Channel - listener net.Listener } type Option func(*Server) diff --git a/server/server_test.go b/server/server_test.go index cdd4c8c..e3cd988 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -2,7 +2,6 @@ package server import ( "context" - "fmt" "net/http" "testing" "time" @@ -256,7 +255,8 @@ func TestServer_Addr(t *testing.T) { t.Error("Expected server to start") } - fmt.Println(server.listener) + // Wait for the server to fully start + time.Sleep(1 * time.Millisecond) addr := server.Addr()