Skip to content

Commit

Permalink
server: Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Dec 6, 2021
1 parent 69807c4 commit 381768f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion server/segment_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ var errFormat = errors.New("unrecognized profile output format")
var errProfile = errors.New("unrecognized encoder profile")
var errDuration = errors.New("invalid duration")
var errCapCompat = errors.New("incompatible capabilities")
var errTimeout = errors.New("timeout")

var dialTimeout = 2 * time.Second

Expand Down
4 changes: 2 additions & 2 deletions server/segment_rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ func TestSubmitSegment_Timeout(t *testing.T) {
headerTimeout = 100 * time.Millisecond
lock.Unlock()
_, err = SubmitSegment(sess, seg, 0, false, true)
assert.Contains(err.Error(), "header timeout: timeout")
assert.Contains(err.Error(), "context canceled")

// time out body
lock.Lock()
Expand Down Expand Up @@ -2282,7 +2282,7 @@ func TestSendReqWithTimeout(t *testing.T) {
resp, err = sendReqWithTimeout(req, time.Millisecond)
wg.Done()
assert.Nil(resp)
assert.ErrorIs(err, errTimeout)
assert.ErrorIs(err, context.Canceled)
}

func stubTLSServer() (*httptest.Server, *http.ServeMux) {
Expand Down

0 comments on commit 381768f

Please sign in to comment.