-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[HTTP/3] Reenable interop tests #56867
Merged
ManickaP
merged 3 commits into
dotnet:main
from
ManickaP:mapichov/54726_enabled_interop_tests
Aug 6, 2021
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,7 +380,6 @@ public async Task ServerCertificateCustomValidationCallback_Succeeds() | |
[OuterLoop] | ||
[ConditionalTheory(nameof(IsMsQuicSupported))] | ||
[MemberData(nameof(InteropUris))] | ||
[ActiveIssue("https://github.com/dotnet/runtime/issues/54726")] | ||
public async Task Public_Interop_ExactVersion_Success(string uri) | ||
{ | ||
if (UseQuicImplementationProvider == QuicImplementationProviders.Mock) | ||
|
@@ -402,18 +401,46 @@ public async Task Public_Interop_ExactVersion_Success(string uri) | |
Assert.Equal(3, response.Version.Major); | ||
} | ||
|
||
[OuterLoop] | ||
[ConditionalTheory(nameof(IsMsQuicSupported))] | ||
[MemberData(nameof(InteropUrisWithContent))] | ||
public async Task Public_Interop_ExactVersion_BufferContent_Success(string uri) | ||
{ | ||
if (UseQuicImplementationProvider == QuicImplementationProviders.Mock) | ||
{ | ||
return; | ||
} | ||
|
||
using HttpClient client = CreateHttpClient(); | ||
using HttpRequestMessage request = new HttpRequestMessage | ||
{ | ||
Method = HttpMethod.Get, | ||
RequestUri = new Uri(uri, UriKind.Absolute), | ||
Version = HttpVersion.Version30, | ||
VersionPolicy = HttpVersionPolicy.RequestVersionExact | ||
}; | ||
using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseContentRead).WaitAsync(TimeSpan.FromSeconds(20)); | ||
|
||
Assert.Equal(HttpStatusCode.OK, response.StatusCode); | ||
Assert.Equal(3, response.Version.Major); | ||
|
||
var content = await response.Content.ReadAsStringAsync(); | ||
Assert.NotEmpty(content); | ||
} | ||
|
||
[OuterLoop] | ||
[ConditionalTheory(nameof(IsMsQuicSupported))] | ||
[MemberData(nameof(InteropUris))] | ||
[ActiveIssue("https://github.com/dotnet/runtime/issues/54726")] | ||
public async Task Public_Interop_Upgrade_Success(string uri) | ||
{ | ||
if (UseQuicImplementationProvider == QuicImplementationProviders.Mock) | ||
{ | ||
return; | ||
} | ||
|
||
using HttpClient client = CreateHttpClient(); | ||
// Create the handler manually without passing in useVersion = Http3 to avoid using VersionHttpClientHandler, | ||
// because it overrides VersionPolicy on each request with RequestVersionExact (bypassing Alt-Svc code path completely). | ||
using HttpClient client = CreateHttpClient(CreateHttpClientHandler(quicImplementationProvider: UseQuicImplementationProvider)); | ||
|
||
// First request uses HTTP/1 or HTTP/2 and receives an Alt-Svc either by header or (with HTTP/2) by frame. | ||
|
||
|
@@ -443,7 +470,7 @@ public async Task Public_Interop_Upgrade_Success(string uri) | |
using HttpResponseMessage responseB = await client.SendAsync(requestB).WaitAsync(TimeSpan.FromSeconds(20)); | ||
|
||
Assert.Equal(HttpStatusCode.OK, responseB.StatusCode); | ||
Assert.NotEqual(3, responseB.Version.Major); | ||
Assert.Equal(3, responseB.Version.Major); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How did this test ever work?? :) |
||
} | ||
} | ||
|
||
|
@@ -754,14 +781,26 @@ private SslApplicationProtocol ExtractMsQuicNegotiatedAlpn(Http3LoopbackConnecti | |
|
||
/// <summary> | ||
/// These are public interop test servers for various QUIC and HTTP/3 implementations, | ||
/// taken from https://github.com/quicwg/base-drafts/wiki/Implementations | ||
/// taken from https://github.com/quicwg/base-drafts/wiki/Implementations and https://bagder.github.io/HTTP3-test/. | ||
/// </summary> | ||
public static TheoryData<string> InteropUris() => | ||
new TheoryData<string> | ||
{ | ||
{ "https://quic.rocks:4433/" }, // Chromium | ||
{ "https://http3-test.litespeedtech.com:4433/" }, // LiteSpeed | ||
{ "https://quic.tech:8443/" } // Cloudflare | ||
{ "https://www.litespeedtech.com/" }, // LiteSpeed | ||
{ "https://quic.tech:8443/" }, // Cloudflare | ||
{ "https://quic.aiortc.org:443/" }, // aioquic | ||
{ "https://h2o.examp1e.net/" } // h2o/quicly | ||
}; | ||
|
||
/// <summary> | ||
/// These are public interop test servers for various QUIC and HTTP/3 implementations, | ||
/// taken from https://github.com/quicwg/base-drafts/wiki/Implementations and https://bagder.github.io/HTTP3-test/. | ||
/// </summary> | ||
public static TheoryData<string> InteropUrisWithContent() => | ||
new TheoryData<string> | ||
{ | ||
{ "https://cloudflare-quic.com/" }, // Cloudflare with content | ||
{ "https://pgjones.dev/" }, // aioquic with content | ||
}; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we validate the actual content too? I don't know how these endpoints work. If they have fixed content that will never change, seems like we could validate that we receive the correct content.
Or if not, can we at least validate that the content exists, i.e. we receive > 0 bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check for non-empty content.
I don't think we should check for a particular content value since these are external and can change any time.