diff options
author | Valery Piashchynski <[email protected]> | 2021-06-03 14:54:06 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-03 14:54:06 +0300 |
commit | 62bbde7936109d18bf1f727974719804dad4c105 (patch) | |
tree | 54fb8493840837294bbe84ba5e1d7663ed027cad /tests/plugins/http/handler_test.go | |
parent | 9c01e7ab1548e1416598b702d63866fa6dc5707b (diff) |
- Do not write an error into the responseWriter if this is internal
error
- Handle SoftJob error
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests/plugins/http/handler_test.go')
-rw-r--r-- | tests/plugins/http/handler_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/plugins/http/handler_test.go b/tests/plugins/http/handler_test.go index f6533dc4..1b7f5bac 100644 --- a/tests/plugins/http/handler_test.go +++ b/tests/plugins/http/handler_test.go @@ -1357,7 +1357,7 @@ func TestHandler_Error3(t *testing.T) { }() assert.NoError(t, err) - assert.Equal(t, 500, r.StatusCode) + assert.Equal(t, 400, r.StatusCode) } func TestHandler_ResponseDuration(t *testing.T) { @@ -1519,12 +1519,12 @@ func TestHandler_ErrorDuration(t *testing.T) { }() time.Sleep(time.Millisecond * 10) - goterr := make(chan interface{}) + goterr := make(chan struct{}, 10) h.AddListener(func(event interface{}) { switch tp := event.(type) { case handler.ErrorEvent: if tp.Elapsed() > 0 { - close(goterr) + goterr <- struct{}{} } default: } @@ -1537,6 +1537,7 @@ func TestHandler_ErrorDuration(t *testing.T) { }() <-goterr + <-goterr assert.Equal(t, 500, r.StatusCode) } |