Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ClientOfficialVersion>3.48.0</ClientOfficialVersion>
<ClientOfficialVersion>3.48.1</ClientOfficialVersion>
<ClientPreviewVersion>3.49.0</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview.0</ClientPreviewSuffixVersion>
<ClientPreviewSuffixVersion>preview.1</ClientPreviewSuffixVersion>
<DirectVersion>3.37.10</DirectVersion>
<FaultInjectionVersion>1.0.0</FaultInjectionVersion>
<FaultInjectionSuffixVersion>beta.0</FaultInjectionSuffixVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ private void ValidateGatewayConnection()
{
if (serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.TooManyRequests
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.ResponseDelay
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.SendDelay)
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.SendDelay
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.DatabaseAccountNotFound
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.ServiceUnavailable
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.InternalServerError
&& serverErrorResult?.GetServerErrorType() != FaultInjectionServerErrorType.LeaseNotFound)
{
throw new ArgumentException($"{serverErrorResult?.GetServerErrorType()} is not supported for metadata requests.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ public enum FaultInjectionServerErrorType
ServiceUnavailable,

/// <summary>
/// 404:1008 Database account not found from gateway
/// 403:1008 Database account not found from gateway
/// </summary>
DatabaseAccountNotFound,

/// <summary>
/// 410:1022 Lease not Found
/// </summary>
LeaseNotFound,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ public HttpResponseMessage GetInjectedServerError(DocumentServiceRequest dsr, st

httpResponse.Headers.Add(
WFConstants.BackendHeaders.SubStatus,
((int)SubStatusCodes.RUBudgetExceeded).ToString(CultureInfo.InvariantCulture));
((int)SubStatusCodes.Unknown).ToString(CultureInfo.InvariantCulture));
httpResponse.Headers.Add(WFConstants.BackendHeaders.LocalLSN, lsn);

return httpResponse;
Expand All @@ -470,7 +470,7 @@ public HttpResponseMessage GetInjectedServerError(DocumentServiceRequest dsr, st

httpResponse = new HttpResponseMessage
{
StatusCode = HttpStatusCode.NotFound,
StatusCode = HttpStatusCode.Forbidden,
Content = new FauntInjectionHttpContent(
new MemoryStream(
FaultInjectionResponseEncoding.GetBytes($"Fault Injection Server Error: DatabaseAccountNotFound, rule: {ruleId}"))),
Expand All @@ -488,6 +488,28 @@ public HttpResponseMessage GetInjectedServerError(DocumentServiceRequest dsr, st

return httpResponse;

case FaultInjectionServerErrorType.LeaseNotFound:

httpResponse = new HttpResponseMessage
{
StatusCode = HttpStatusCode.Gone,
Content = new FauntInjectionHttpContent(
new MemoryStream(
FaultInjectionResponseEncoding.GetBytes($"Fault Injection Server Error: LeaseNotFound, rule: {ruleId}"))),
};

foreach (string header in headers.AllKeys())
{
httpResponse.Headers.Add(header, headers.Get(header));
}

httpResponse.Headers.Add(
WFConstants.BackendHeaders.SubStatus,
((int)SubStatusCodes.LeaseNotFound).ToString(CultureInfo.InvariantCulture));
httpResponse.Headers.Add(WFConstants.BackendHeaders.LocalLSN, lsn);

return httpResponse;

default:
throw new ArgumentException($"Server error type {this.serverErrorType} is not supported");
}
Expand Down
1,703 changes: 1,703 additions & 0 deletions Microsoft.Azure.Cosmos/contracts/API_3.48.1.txt

Large diffs are not rendered by default.

Loading
Loading