Skip to content

Commit

Permalink
Fixing a failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
duricanikolic committed Jun 11, 2024
1 parent d9df5cc commit 09c80b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/distributor/distributor_ingest_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func TestDistributor_Push_ShouldReturnErrorMappedTo4xxStatusCodeIfWriteRequestCo
// We expect a gRPC error.
errStatus, ok := grpcutil.ErrorToStatus(err)
require.True(t, ok)
assert.Equal(t, codes.FailedPrecondition, errStatus.Code())
assert.Equal(t, codes.InvalidArgument, errStatus.Code())
assert.ErrorContains(t, errStatus.Err(), ingest.ErrWriteRequestDataItemTooLarge.Error())

// We expect the gRPC error to be detected as client error.
Expand Down
3 changes: 1 addition & 2 deletions pkg/distributor/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,8 @@ func toGRPCStatusCode(errCause mimirpb.ErrorCause, serviceOverloadErrorEnabled b
case mimirpb.INGESTION_RATE_LIMITED, mimirpb.REQUEST_RATE_LIMITED:
if serviceOverloadErrorEnabled {
return codes.Unavailable
} else {
return codes.ResourceExhausted
}
return codes.ResourceExhausted
case mimirpb.REPLICAS_DID_NOT_MATCH:
return codes.AlreadyExists
case mimirpb.TOO_MANY_CLUSTERS:
Expand Down

0 comments on commit 09c80b6

Please sign in to comment.