Skip to content

[HTTP] httpbin sometimes returns 503#128999

Open
ManickaP wants to merge 1 commit into
dotnet:mainfrom
ManickaP:fix-httpbin
Open

[HTTP] httpbin sometimes returns 503#128999
ManickaP wants to merge 1 commit into
dotnet:mainfrom
ManickaP:fix-httpbin

Conversation

@ManickaP
Copy link
Copy Markdown
Member

@ManickaP ManickaP commented Jun 4, 2026

Fix for httpbin returning 503, which is out of our control.
Based on Kusto, started 28.5., seen in #128940

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

{
using HttpResponseMessage response = await client.GetAsync(uri);
if (response.StatusCode is HttpStatusCode.GatewayTimeout or HttpStatusCode.BadGateway)
if (response.StatusCode is HttpStatusCode.GatewayTimeout or HttpStatusCode.BadGateway or HttpStatusCode.ServiceUnavailable)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would feel we can ignore any 500+ codes .... but simply adding the open we see is fine too.

if (response.StatusCode is HttpStatusCode.GatewayTimeout or HttpStatusCode.BadGateway)
if (response.StatusCode is HttpStatusCode.GatewayTimeout or HttpStatusCode.BadGateway or HttpStatusCode.ServiceUnavailable)
{
// Ignore the erroneous status code, the test depends on an external server that is out of our control.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we mark the tests as skipped or is it good enough we could talk to the server and get some answer back.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces flakiness in the HTTP remote-server decompression tests by treating occasional 503 ServiceUnavailable responses from the external httpbin.org/deflate endpoint as an ignorable transient failure (similar to existing handling for 502/504).

Changes:

  • Extend the set of “ignore and return” HTTP status codes in the httpbin deflate decompression test to include HttpStatusCode.ServiceUnavailable (503).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants