diff options
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) } |