summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-03 12:48:46 +0300
committerWolfy-J <[email protected]>2019-05-03 12:48:46 +0300
commit9ec8db5642eec7f5ef85f91aaf09743db82d2710 (patch)
treeb46cc2e606058aa4fd5af4bd430a1a2cf14493a2
parentaa2754aed64bd0b54b1e2c4090a28a2e6b566361 (diff)
more tests, watcher tests
-rw-r--r--server_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/server_test.go b/server_test.go
index b86a5a66..c973d634 100644
--- a/server_test.go
+++ b/server_test.go
@@ -33,6 +33,25 @@ func TestServer_PipesEcho(t *testing.T) {
assert.Equal(t, "hello", res.String())
}
+func TestServer_NoPool(t *testing.T) {
+ rr := NewServer(
+ &ServerConfig{
+ Command: "php tests/client.php echo pipes",
+ Relay: "pipes",
+ Pool: &Config{
+ NumWorkers: int64(runtime.NumCPU()),
+ AllocateTimeout: time.Second,
+ DestroyTimeout: time.Second,
+ },
+ })
+ defer rr.Stop()
+
+ res, err := rr.Exec(&Payload{Body: []byte("hello")})
+
+ assert.Error(t, err)
+ assert.Nil(t, res)
+}
+
func TestServer_SocketEcho(t *testing.T) {
rr := NewServer(
&ServerConfig{