diff options
author | Wolfy-J <[email protected]> | 2019-05-03 12:54:15 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2019-05-03 12:54:15 +0300 |
commit | 457ec8eac0f5267e61871de87c3f4daa9f595be0 (patch) | |
tree | 3a6d114593af1b28929e68a52a549b13e5157d9a | |
parent | 9ec8db5642eec7f5ef85f91aaf09743db82d2710 (diff) |
more tests
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | util/state_test.go | 22 |
2 files changed, 23 insertions, 0 deletions
@@ -13,6 +13,7 @@ test: go test -v -race -cover go test -v -race -cover ./util go test -v -race -cover ./service + go test -v -race -cover ./service/util go test -v -race -cover ./service/env go test -v -race -cover ./service/rpc go test -v -race -cover ./service/http diff --git a/util/state_test.go b/util/state_test.go index 2afe682e..150f8533 100644 --- a/util/state_test.go +++ b/util/state_test.go @@ -30,6 +30,28 @@ func TestServerState(t *testing.T) { assert.Len(t, state, runtime.NumCPU()) } +func TestDeadWorker(t *testing.T) { + rr := roadrunner.NewServer( + &roadrunner.ServerConfig{ + Command: "php ../tests/client.php echo tcp", + Relay: "tcp://:9007", + RelayTimeout: 10 * time.Second, + Pool: &roadrunner.Config{ + NumWorkers: 1, + AllocateTimeout: time.Second, + DestroyTimeout: time.Second, + }, + }) + + assert.NoError(t, rr.Start()) + w := rr.Workers()[0] + rr.Stop() + *w.Pid = 0 + + _, err := WorkerState(w) + assert.Error(t, err) +} + func TestServerState_Err(t *testing.T) { _, err := ServerState(nil) assert.Error(t, err) |