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

fix(ext/websocket): Ensure that errors are available after async response returns #19642

Merged
merged 12 commits into from
Jun 29, 2023

Conversation

mmastrac
Copy link
Contributor

@mmastrac mmastrac commented Jun 28, 2023

Fixes the WPT tests that test w/invalid codes. Also explicitly ignoring some h2 tests to hopefully prevent flakes.

The previous changes to WebSocketStream introduced a bug where the close errors were not made available if the pull method was re-entrant.

@bartlomieju
Copy link
Member

bartlomieju commented Jun 28, 2023

Maybe we can revert 3fe44a5 with this change?

@mmastrac
Copy link
Contributor Author

Maybe we can revert 3fe44a5 with this change?

I think so. I'll do that as part of this PR.

@mmastrac mmastrac changed the title fix(ext/websockets): Ignore close/abort/cancel with invalid code fix(ext/websocket): Ignore close/abort/cancel with invalid code Jun 28, 2023
@mmastrac mmastrac changed the title fix(ext/websocket): Ignore close/abort/cancel with invalid code fix(ext/websocket): Ignore close/abort/cancel with invalid code (spec compliance) Jun 28, 2023
@mmastrac mmastrac marked this pull request as draft June 29, 2023 01:12
@@ -154,7 +154,6 @@ export async function runSingleTest(
harnessStatus = JSON.parse(line.slice(5));
} else {
stderr += line + "\n";
console.error(line);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was confusing test results by printing out-of-order

Copy link
Member

Choose a reason for hiding this comment

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

Good catch 👍

tools/wpt.ts Outdated
@@ -611,6 +611,7 @@ function reportVariation(result: TestResult, expectation: boolean | string[]) {
for (const result of expectedFailedButPassed) {
console.log(` ${JSON.stringify(result.name)}`);
}
console.log("\nstderr:\n" + result.stderr);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes stderr output consistent.

@mmastrac mmastrac changed the title fix(ext/websocket): Ignore close/abort/cancel with invalid code (spec compliance) fix(ext/websocket): Ensure that errors are available after async response returns Jun 29, 2023
@mmastrac mmastrac marked this pull request as ready for review June 29, 2023 01:21
@@ -567,8 +567,9 @@ function analyzeTestResult(

function reportVariation(result: TestResult, expectation: boolean | string[]) {
if (result.status !== 0 || result.harnessStatus === null) {
console.log(`test stderr:`);
writeAllSync(Deno.stdout, new TextEncoder().encode(result.stderr));
if (result.stderr) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Print stderr consistently between modes.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

@mmastrac mmastrac merged commit 93b3ff0 into denoland:main Jun 29, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants