Skip to content

Commit

Permalink
Reduce the default timeout for tests going to the web
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanotti committed Mar 4, 2023
1 parent 08c621a commit 43c7a7e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/IntegrationTests/DotNetCliTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private static void ChangeDefaultProgramToHttpClient()
{
const string ProgramContent = @"
using var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(5);
using var response = await httpClient.GetAsync(""http://example.com"");
Console.WriteLine(response.StatusCode);
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static async Task Main(string[] args)
await PingRedis(args);

using var client = new HttpClient();
client.Timeout = TimeSpan.FromSeconds(5);
await client.GetStringAsync("https://www.bing.com", cancellation.Token);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
// </copyright>

var httpClient = new HttpClient();
httpClient.Timeout = TimeSpan.FromSeconds(5);
var response = await httpClient.GetAsync("http://example.com");
Console.WriteLine(response.StatusCode);

0 comments on commit 43c7a7e

Please sign in to comment.