"4:Deadline Exceeded. debug_error_string:{\"created\":\"@1598938192.005782000\",\"description\":\"Error received from peer unix:/home/git/gitalypraefect.socket\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1055,\"grpc_message\":\"Deadline Exceeded\",\"grpc_status\":4}"
'GRPC::DeadlineExceeded',
'4:Deadline Exceeded. debug_error_string:{"created":"@1598938192.005782000","description":"Error received from peer unix:/home/git/gitalypraefect.socket","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"Deadline Exceeded","grpc_status":4}'
]
}
end
let(:expected)do
{
fingerprint: [
"GRPC::DeadlineExceeded",
"4:Deadline Exceeded."
],
exception: {
values: [
{
type: "GRPC::DeadlineExceeded",
value: "4:DeadlineExceeded."
}
]
},
extra: {
caller: 'test',
grpc_debug_error_string: "{\"hello\":1}"
}
}
end
it'removes the debug error string and stores it as an extra field'do
@@ -195,6 +196,55 @@ RSpec.describe Gitlab::ErrorTracking do
end
end
context'when the error is kind of an `ActiveRecord::StatementInvalid`'do
let(:exception){ActiveRecord::StatementInvalid.new(sql: 'SELECT "users".* FROM "users" WHERE "users"."id" = 1 AND "users"."foo" = $1')}
it'injects the normalized sql query into extra'do
track_exception
expect(sentry_event.dig('extra','sql')).toeq('SELECT "users".* FROM "users" WHERE "users"."id" = $2 AND "users"."foo" = $1')
end
end
context'when the `ActiveRecord::StatementInvalid` is wrapped in another exception'do
it'injects the normalized sql query into extra'do
allow(exception).toreceive(:cause).and_return(ActiveRecord::StatementInvalid.new(sql: 'SELECT "users".* FROM "users" WHERE "users"."id" = 1 AND "users"."foo" = $1'))
track_exception
expect(sentry_event.dig('extra','sql')).toeq('SELECT "users".* FROM "users" WHERE "users"."id" = $2 AND "users"."foo" = $1')
context'when the `ActiveRecord::StatementInvalid` is wrapped in another exception'do
let(:exception){RuntimeError.new(cause: ActiveRecord::StatementInvalid.new(sql: 'SELECT "users".* FROM "users" WHERE "users"."id" = 1 AND "users"."foo" = $1'))}
fset.UintVar(&cfg.APILimit,"apiLimit",0,"Number of API requests allowed at single time")
fset.UintVar(&cfg.APIQueueLimit,"apiQueueLimit",0,"Number of API requests allowed to be queued")
fset.DurationVar(&cfg.APIQueueTimeout,"apiQueueDuration",queueing.DefaultTimeout,"Maximum queueing duration of requests")
fset.DurationVar(&cfg.APICILongPollingDuration,"apiCiLongPollingDuration",50*time.Second,"Long polling duration for job requesting for runners (default 50s - enabled)")
fset.DurationVar(&cfg.APICILongPollingDuration,"apiCiLongPollingDuration",50,"Long polling duration for job requesting for runners (default 50s - enabled)")
fset.BoolVar(&cfg.PropagateCorrelationID,"propagateCorrelationID",false,"Reuse existing Correlation-ID from the incoming request header `X-Request-ID` if present")