Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WASI] disable part of HttpBuildThenRunThenPublish #108186

Merged
merged 1 commit into from
Sep 24, 2024
Merged
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
15 changes: 9 additions & 6 deletions src/mono/wasi/testassets/Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ public static async Task<int> MainAsync(string[] args)
impatientClient1.Timeout = TimeSpan.FromMilliseconds(10);
try {
await impatientClient1.GetAsync("https://corefx-net-http11.azurewebsites.net/Echo.ashx?delay10sec");
throw new Exception("request should have timed out");
// in reality server side doesn't delay because it doesn't implement it. So 10ms is bit fragile.
// TODO: remove this once we have real WASI HTTP library unit tests with local server loop in Xharness.
// https://github.com/dotnet/xharness/pull/1244

// https://github.com/dotnet/runtime/issues/107530
// TODO throw new Exception("request should have timed out");
} catch (TaskCanceledException) {
Console.WriteLine("1st impatientClient was canceled as expected");
}
Expand All @@ -48,11 +53,9 @@ public static async Task<int> MainAsync(string[] args)
impatientClient2.DefaultRequestHeaders.Add("User-Agent", "dotnet WASI unit test");
var cts = new CancellationTokenSource(10);
try {
// in reality server side doesn't delay because it doesn't implement it. So 10ms is bit fragile.
// TODO: remove this once we have real WASI HTTP library unit tests with local server loop in Xharness.
// https://github.com/dotnet/xharness/pull/1244
await impatientClient2.GetAsync("https://corefx-net-http11.azurewebsites.net/Echo.ashx?delay10sec", cts.Token);
throw new Exception("request should have timed out");
// https://github.com/dotnet/runtime/issues/107530
// TODO throw new Exception("request should have timed out");
} catch (TaskCanceledException tce) {
if (cts.Token != tce.CancellationToken)
{
Expand All @@ -64,7 +67,7 @@ public static async Task<int> MainAsync(string[] args)
using HttpClient client = new();
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Add("User-Agent", "dotnet WASI unit test");

var query="https://corefx-net-http11.azurewebsites.net/Echo.ashx";
var json = await client.GetStringAsync(query);

Expand Down
Loading