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

Set harness error if async_test function returns a value #25703

Merged
merged 4 commits into from Sep 25, 2020

Conversation

stephenmcgruer
Copy link
Contributor

Cherry-picks and modifies work done by frehner@ in
#24021

Fixes #21435

Co-authored-by: Anthony Frehner afrehner.work@gmail.com

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25703 September 23, 2020 12:50 Inactive
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25703 September 23, 2020 16:44 Inactive
Cherry-picks and modifies work done by frehner@ in
#24021

Fixes #21435

Co-authored-by: Anthony Frehner <afrehner.work@gmail.com>
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25703 September 24, 2020 12:30 Inactive
@stephenmcgruer
Copy link
Contributor Author

Latest run on Chrome Dev is good - no new errors.

Since the change should show up for any browser, modulo crashes (as its just looking for the return value of the function given to async_test), I'm happy to send this for review now.

@stephenmcgruer stephenmcgruer changed the title [WIP] Set harness error if async_test function returns a value Set harness error if async_test function returns a value Sep 24, 2020
@stephenmcgruer stephenmcgruer marked this pull request as ready for review September 24, 2020 15:57
Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

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

Sweeeeeeeeeeet!

resources/testharness.js Outdated Show resolved Hide resolved
Co-authored-by: Philip Jägenstedt <philip@foolip.org>
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25703 September 25, 2020 00:59 Inactive
Copy link
Contributor

@jgraham jgraham left a comment

Choose a reason for hiding this comment

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

Have we verified that this doesn't cause any breakage?

resources/testharness.js Outdated Show resolved Hide resolved
resources/testharness.js Show resolved Hide resolved
var value = test_obj.step(func, test_obj, test_obj);
if (value !== undefined) {
var msg = "Test named \"" + test_name +
"\" inappropriately returned a value";
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's clear what it means for the test to return a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree! I've reworked the wording here, please let me know if it reads better.

Copy link
Contributor Author

@stephenmcgruer stephenmcgruer left a comment

Choose a reason for hiding this comment

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

Have we verified that this doesn't cause any breakage?

As per this comment, I've run two Chrome Dev trigger runs. The first turned up ~6 cases I had previously missed, once those were fixed the second appears to be clean.

It's possible that we have some test that is returning a value only on not-Chrome, but it seems unlikely to me? Happy to do trigger runs on other browsers if you want.

resources/testharness.js Show resolved Hide resolved
resources/testharness.js Outdated Show resolved Hide resolved
var value = test_obj.step(func, test_obj, test_obj);
if (value !== undefined) {
var msg = "Test named \"" + test_name +
"\" inappropriately returned a value";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree! I've reworked the wording here, please let me know if it reads better.

@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-25703 September 25, 2020 12:42 Inactive
@stephenmcgruer
Copy link
Contributor Author

Given the change I had to make to resources/test/tests/unit/exceptional-cases.html, I wonder if we should relax this to only care about things that return then-ables. On the other hand, no real test does anything like that unittest does, so maybe its fine.

@stephenmcgruer stephenmcgruer merged commit 2966c80 into master Sep 25, 2020
@stephenmcgruer stephenmcgruer deleted the smcgruer/ban_async_async branch September 25, 2020 17:50
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.

async_test with async function produces undesirable results
4 participants