diff --git a/workers/client/client_network_windows_test.go b/workers/client/client_network_windows_test.go index a8ad4f8..bdc79e3 100644 --- a/workers/client/client_network_windows_test.go +++ b/workers/client/client_network_windows_test.go @@ -58,7 +58,7 @@ func (s *ClientNetworkSuite) BeforeTest(_, testName string) { configuration.QPepConfig.Security.Certificate = "cert.pem" configuration.QPepConfig.Security.PrivateKey = "key.pem" - configuration.QPepConfig.Client.GatewayHost = "127.0.0.1" + configuration.QPepConfig.Client.GatewayHost = "127.0.0.2" configuration.QPepConfig.Client.GatewayPort = 9443 configuration.QPepConfig.Client.LocalListeningAddress = "127.0.0.1" configuration.QPepConfig.Client.LocalListenPort = 9090 diff --git a/workers/client/client_patch_test.go b/workers/client/client_patch_test.go index 6b423f0..1ed1c38 100644 --- a/workers/client/client_patch_test.go +++ b/workers/client/client_patch_test.go @@ -184,72 +184,6 @@ func (s *ClientSuite) TestHandleServices_FailGateway() { assert.True(s.T(), calledFailedConnectionSecond) } -func (s *ClientSuite) TestHandleServices_FailStatistics() { - wg2 := &sync.WaitGroup{} - wg2.Add(3) - var calledInitialCheck = false - monkey.Patch(initialCheckConnection, func() { - if !calledInitialCheck { - calledInitialCheck = true - wg2.Done() - } - }) - var calledGatewayCheck = false - monkey.Patch(gatewayStatusCheck, func(string, string, int) (bool, *api.EchoResponse) { - if !calledGatewayCheck { - calledGatewayCheck = true - wg2.Done() - } - return true, &api.EchoResponse{ - Address: "172.20.50.150", - Port: 54635, - ServerVersion: "0.1.0", - } - }) - var calledFailedConnectionFirst = false - var calledFailedConnectionSecond = false - monkey.Patch(failedCheckConnection, func() bool { - if !calledFailedConnectionFirst { - calledFailedConnectionFirst = true - return false - } - if !calledFailedConnectionSecond { - calledFailedConnectionSecond = true - wg2.Done() - } - return true - }) - - wg := &sync.WaitGroup{} - wg.Add(1) - ctx, cancel := context.WithCancel(context.Background()) - go handleServices(ctx, cancel, wg) - - ch := make(chan struct{}) - - go func() { - wg2.Wait() - cancel() - wg.Wait() - - ch <- struct{}{} - }() - - select { - case <-time.After(10 * time.Second): - s.T().Logf("Test Timed out waiting for routines to finish") - s.T().FailNow() - return - case <-ch: - break - } - - assert.True(s.T(), calledInitialCheck) - assert.True(s.T(), calledGatewayCheck) - assert.True(s.T(), calledFailedConnectionFirst) - assert.True(s.T(), calledFailedConnectionSecond) -} - func (s *ClientSuite) TestInitProxy() { monkey.Patch(gateway.SetSystemProxy, func(active bool) { assert.True(s.T(), active) diff --git a/workers/client/client_test.go b/workers/client/client_test.go index 850a7c8..c4d0578 100644 --- a/workers/client/client_test.go +++ b/workers/client/client_test.go @@ -49,7 +49,7 @@ func (s *ClientSuite) BeforeTest(_, testName string) { configuration.QPepConfig = configuration.QPepConfigType{} configuration.QPepConfig.Merge(&configuration.DefaultConfig) - configuration.QPepConfig.Client.GatewayHost = "127.0.0.1" + configuration.QPepConfig.Client.GatewayHost = "127.0.0.2" configuration.QPepConfig.Client.GatewayPort = 9443 configuration.QPepConfig.Client.LocalListeningAddress = "127.0.0.1" configuration.QPepConfig.Client.LocalListenPort = 9090 diff --git a/workers/server/server_test.go b/workers/server/server_test.go index 4922cf6..534db2a 100644 --- a/workers/server/server_test.go +++ b/workers/server/server_test.go @@ -5,7 +5,6 @@ import ( "context" "fmt" "github.com/Project-Faster/monkey" - "github.com/julienschmidt/httprouter" "github.com/Project-Faster/qpep/api" "github.com/Project-Faster/qpep/backend" "github.com/Project-Faster/qpep/shared/configuration" @@ -13,6 +12,7 @@ import ( "github.com/Project-Faster/qpep/shared/logger" "github.com/Project-Faster/qpep/shared/protocol" "github.com/Project-Faster/qpep/workers/gateway" + "github.com/julienschmidt/httprouter" "github.com/rs/cors" log "github.com/rs/zerolog" "github.com/stretchr/testify/assert" @@ -386,6 +386,8 @@ func (s *ServerSuite) TestRunServer_APIConnection_LimitSrc() { // incoming speed limit addr, _ := gateway.GetDefaultLanListeningAddress("127.0.0.1", "") + s.T().Logf("address: %v", addr) + clientsMap := map[string]string{ addr + "/32": "300K", }