diff options
author | Anton Titov <[email protected]> | 2019-12-23 15:53:51 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-23 15:53:51 +0300 |
commit | a11a3a5511a7b986f06c5921932e3438a0a543d7 (patch) | |
tree | ce930d93d3f887da0a74c7bf0ce2b2c5173d1ca3 /service | |
parent | 7f2909ffb746880a380dbc8b9d7f4257a5abca6c (diff) | |
parent | b0c299387222c9a32b92a11abb30c85e5c7f4741 (diff) |
Merge pull request #224 from spiral/feature/reuse-ports-and-test-improvements
Test improvements
Diffstat (limited to 'service')
-rw-r--r-- | service/health/service_test.go | 26 | ||||
-rw-r--r-- | service/rpc/config_test.go | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/service/health/service_test.go b/service/health/service_test.go index d346d92b..e8685548 100644 --- a/service/health/service_test.go +++ b/service/health/service_test.go @@ -90,10 +90,10 @@ func TestService_Serve_DeadWorker(t *testing.T) { assert.NoError(t, c.Init(&testCfg{ healthCfg: `{ - "address": "localhost:2116" + "address": "localhost:2117" }`, httpCfg: `{ - "address": "localhost:2115", + "address": "localhost:2118", "workers":{ "command": "php ../../tests/http/slow-client.php echo pipes 1000", "pool": {"numWorkers": 1} @@ -126,7 +126,7 @@ func TestService_Serve_DeadWorker(t *testing.T) { } // Check health check - _, res, err := get("http://localhost:2116/") + _, res, err := get("http://localhost:2117/") assert.NoError(t, err) assert.Equal(t, http.StatusInternalServerError, res.StatusCode) } @@ -141,10 +141,10 @@ func TestService_Serve_DeadWorkerStillHealthy(t *testing.T) { assert.NoError(t, c.Init(&testCfg{ healthCfg: `{ - "address": "localhost:2116" + "address": "localhost:2119" }`, httpCfg: `{ - "address": "localhost:2115", + "address": "localhost:2120", "workers":{ "command": "php ../../tests/http/client.php echo pipes", "pool": {"numWorkers": 2} @@ -177,7 +177,7 @@ func TestService_Serve_DeadWorkerStillHealthy(t *testing.T) { } // Check health check - _, res, err := get("http://localhost:2116/") + _, res, err := get("http://localhost:2119/") assert.NoError(t, err) assert.Equal(t, http.StatusOK, res.StatusCode) } @@ -191,7 +191,7 @@ func TestService_Serve_NoHTTPService(t *testing.T) { assert.NoError(t, c.Init(&testCfg{ healthCfg: `{ - "address": "localhost:2116" + "address": "localhost:2121" }`, })) @@ -212,10 +212,10 @@ func TestService_Serve_NoServer(t *testing.T) { assert.NoError(t, c.Init(&testCfg{ healthCfg: `{ - "address": "localhost:2116" + "address": "localhost:2122" }`, httpCfg: `{ - "address": "localhost:2115", + "address": "localhost:2123", "workers":{ "command": "php ../../tests/http/client.php echo pipes", "pool": {"numWorkers": 1} @@ -243,7 +243,7 @@ func TestService_Serve_NoServer(t *testing.T) { // Set the httpService to nil healthSvc.httpService = nil - _, res, err := get("http://localhost:2116/") + _, res, err := get("http://localhost:2122/") assert.NoError(t, err) assert.Equal(t, http.StatusInternalServerError, res.StatusCode) } @@ -260,10 +260,10 @@ func TestService_Serve_NoPool(t *testing.T) { assert.NoError(t, c.Init(&testCfg{ healthCfg: `{ - "address": "localhost:2116" + "address": "localhost:2124" }`, httpCfg: `{ - "address": "localhost:2115", + "address": "localhost:2125", "workers":{ "command": "php ../../tests/http/client.php echo pipes", "pool": {"numWorkers": 1} @@ -291,7 +291,7 @@ func TestService_Serve_NoPool(t *testing.T) { // Stop the pool httpSvc.Server().Stop() - _, res, err := get("http://localhost:2116/") + _, res, err := get("http://localhost:2124/") assert.NoError(t, err) assert.Equal(t, http.StatusInternalServerError, res.StatusCode) } diff --git a/service/rpc/config_test.go b/service/rpc/config_test.go index 6791128b..c65e7415 100644 --- a/service/rpc/config_test.go +++ b/service/rpc/config_test.go @@ -81,7 +81,7 @@ func Test_Config_Error(t *testing.T) { ln, err := cfg.Listener() assert.Nil(t, ln) assert.Error(t, err) - assert.Equal(t, "Invalid DSN (tcp://:6001, unix://file.sock)", err.Error()) + assert.Equal(t, "invalid DSN (tcp://:6001, unix://file.sock)", err.Error()) } func Test_Config_ErrorMethod(t *testing.T) { |