diff options
author | Valery Piashchynski <[email protected]> | 2021-05-06 20:02:48 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-05-06 20:02:48 +0300 |
commit | 797e25b47ef2e8aa01c1ded697fc0fd65d0bf511 (patch) | |
tree | 7cc360a96aef8b437a5e703b244ab2643c9b6f86 /pkg/pool/supervisor_test.go | |
parent | 009b7009885d8a15e6fa6c7e78436087b2f20129 (diff) |
- Fix bug with exec_ttl
- Update CHANGELOG
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/pool/supervisor_test.go')
-rw-r--r-- | pkg/pool/supervisor_test.go | 28 |
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), |