summaryrefslogtreecommitdiff
path: root/pkg/pool/supervisor_test.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-05-12 20:23:21 +0300
committerValery Piashchynski <[email protected]>2021-05-12 20:23:21 +0300
commitbf28e244848b21709e142cd5e2fe07953e878f21 (patch)
treed0f063969ce907ee7f332adf73e02958ea2428ff /pkg/pool/supervisor_test.go
parent4236dfac2cd65a9031b04aa659448152868a4190 (diff)
parent4b0a9860c3874c7fa8a0cb9ee7f0ec2be72b03d5 (diff)
Merge branch 'beta' into stablev2.2.0
Diffstat (limited to 'pkg/pool/supervisor_test.go')
-rw-r--r--pkg/pool/supervisor_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/pkg/pool/supervisor_test.go b/pkg/pool/supervisor_test.go
index d7e97fdd..dc307c33 100644
--- a/pkg/pool/supervisor_test.go
+++ b/pkg/pool/supervisor_test.go
@@ -53,6 +53,34 @@ func TestSupervisedPool_Exec(t *testing.T) {
p.Destroy(context.Background())
}
+// This test should finish without freezes
+func TestSupervisedPool_ExecWithDebugMode(t *testing.T) {
+ var cfgSupervised = cfgSupervised
+ cfgSupervised.Debug = true
+
+ ctx := context.Background()
+ p, err := Initialize(
+ ctx,
+ func() *exec.Cmd { return exec.Command("php", "../../tests/memleak.php", "pipes") },
+ pipe.NewPipeFactory(),
+ cfgSupervised,
+ )
+
+ assert.NoError(t, err)
+ assert.NotNil(t, p)
+
+ for i := 0; i < 100; i++ {
+ time.Sleep(time.Millisecond * 100)
+ _, err = p.Exec(payload.Payload{
+ Context: []byte(""),
+ Body: []byte("foo"),
+ })
+ assert.NoError(t, err)
+ }
+
+ p.Destroy(context.Background())
+}
+
func TestSupervisedPool_ExecTTL_TimedOut(t *testing.T) {
var cfgExecTTL = Config{
NumWorkers: uint64(1),