diff options
author | Valery Piashchynski <[email protected]> | 2021-11-25 15:54:59 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-11-25 15:54:59 +0300 |
commit | 2c11cfa516c63992132c9fa232d86dcade338691 (patch) | |
tree | 4ac5ae5513024a6838f08530298f49980d1caa2e /pool | |
parent | 6c5e3ab6c01d31caa2d14930c188bae697c5cd48 (diff) | |
parent | 5282f151a7a7fa46e014fd3c34429a675495c9e8 (diff) |
[#863]: feat(worker): print bad header in case of CRC error
Diffstat (limited to 'pool')
-rwxr-xr-x | pool/static_pool_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pool/static_pool_test.go b/pool/static_pool_test.go index 717d301e..8e2667ac 100755 --- a/pool/static_pool_test.go +++ b/pool/static_pool_test.go @@ -23,8 +23,8 @@ import ( var cfg = &Config{ NumWorkers: uint64(runtime.NumCPU()), - AllocateTimeout: time.Second * 5, - DestroyTimeout: time.Second * 5, + AllocateTimeout: time.Second * 500, + DestroyTimeout: time.Second * 500, } func Test_NewPool(t *testing.T) { @@ -560,6 +560,19 @@ func Test_Static_Pool_WrongCommand2(t *testing.T) { assert.Nil(t, p) } +func Test_CRC_WithPayload(t *testing.T) { + ctx := context.Background() + _, err := Initialize( + ctx, + func() *exec.Cmd { return exec.Command("php", "../tests/crc_error.php") }, + pipe.NewPipeFactory(), + cfg, + ) + assert.Error(t, err) + data := err.Error() + assert.Contains(t, data, "warning: some weird php erro") +} + /* PTR: Benchmark_Pool_Echo-32 49076 29926 ns/op 8016 B/op 20 allocs/op Benchmark_Pool_Echo-32 47257 30779 ns/op 8047 B/op 20 allocs/op |