HTTP trigger http-stream tests (#1241)

This commit is contained in:
Reed Allman
2018-09-26 05:25:48 -07:00
committed by Owen Cliffe
parent 5d907821b1
commit 01b8e8679d
20 changed files with 548 additions and 403 deletions

View File

@@ -755,13 +755,18 @@ func (s *hotSlot) dispatch(ctx context.Context, call *call) chan error {
}
go func() {
// TODO it's possible we can get rid of this (after getting rid of logs API) - may need for call id/debug mode still
// TODO there's a timeout race for swapping this back if the container doesn't get killed for timing out, and don't you forget it
swapBack := s.container.swap(nil, call.stderr, call.stderr, &call.Stats)
defer swapBack()
resp, err := s.udsClient.Do(req)
if err != nil {
common.Logger(ctx).WithError(err).Error("Got error from UDS socket")
errApp <- models.NewAPIError(http.StatusBadGateway, errors.New("error receiving function response"))
return
}
common.Logger(ctx).WithField("status", resp.StatusCode).Debug("Got resp from UDS socket")
common.Logger(ctx).WithField("resp", resp).Debug("Got resp from UDS socket")
defer resp.Body.Close()