Skip to content

Commit

Permalink
end-to-end-test: Set a timeout when invoking Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
armsnyder committed Nov 7, 2020
1 parent d6db51e commit fe6d04f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/server/server_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,18 @@ func (c *clientConnection) sendType(typ string, message interface{}) {
if err != nil {
panic(err)
}
_, err = Handler(c.ctx, events.APIGatewayWebsocketProxyRequest{

ctx, cancel := context.WithTimeout(c.ctx, time.Second)
defer cancel()

_, err = Handler(ctx, events.APIGatewayWebsocketProxyRequest{
Body: string(b),
RequestContext: events.APIGatewayWebsocketProxyRequestContext{
ConnectionID: c.connID,
EventType: typ,
},
})

Expect(err).NotTo(HaveOccurred())
}

Expand Down

0 comments on commit fe6d04f

Please sign in to comment.