summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-03 13:16:48 +0300
committerWolfy-J <[email protected]>2019-05-03 13:16:48 +0300
commitece33086ee1dfbf82e10665165054f6d7d2af1ed (patch)
tree5f44d54468bfee6314c9039dd62041f20e6d8737 /util
parent29bae6225fc6cc9241c92f6dfb6f0ffe7de0f4e5 (diff)
simpler dead worker test
Diffstat (limited to 'util')
-rw-r--r--util/state_test.go19
1 files changed, 3 insertions, 16 deletions
diff --git a/util/state_test.go b/util/state_test.go
index 5b5276be..d52bee1d 100644
--- a/util/state_test.go
+++ b/util/state_test.go
@@ -31,23 +31,10 @@ func TestServerState(t *testing.T) {
}
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,
- },
- })
- defer rr.Stop()
-
- assert.NoError(t, rr.Start())
- w := rr.Workers()[0]
+ w := &roadrunner.Worker{}
+ i := 0
- *w.Pid = 0
+ w.Pid = &i
_, err := WorkerState(w)
assert.Error(t, err)