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

[offscreen-canvas] Correctly report result of asynchronous operations #20277

Merged

Conversation

jugglinmike
Copy link
Contributor

This resolves gh-20180.

In master today, the test results are misrepresenting implementation status. Many failing tests are incorrectly reporting as having passed. Some of them also report an error in the testing harness (which ought to hint that something is going wrong), but many claim to be OK.

This patch makes the tests accurately report PASS or FAIL and removes the test harness errors.

To demonstrate this, I scheduled trials for the patch in Chrome and Firefox. We can use https://wpt.fyi to compare the results reported for each browser with and without this patch (hint: there is a toggle button in the UI just below the icon labeled "diff" that helps you to view only differences):

Firefox does not implement OffscreenCanvas, so (as expected) this patch had no effect on Firefox's results. There is one discrepancy, but that's due to an unrelated crash--something that happens from time to time in the test environment.

Chrome's results are much improved. Individual test results changed in one of two ways, as reported in the wpt.fyi UI:

  • +1 / -1 / 0 - this means there is one more passing "statistic" and one more failing "statistic." The statistics combine subtest results and harness status, so this specifically means: the harness status changed from ERROR to OK and the subtest result changed from PASS to FAIL.
  • 0 / -1 / 0 - here, the harness status was unchanged, and the subtest result changed from PASS to FAIL.

I've split this into two commits: one for the template and source file changes, and one for the corresponding changes to the generated test material. I don't know how you folks prefer to review or merge changes like this, though, and I'm happy to reconfigure as you please.

Update the templates and test body code to correctly track the status of
asynchronous operations. Remove invocations of the `deferTest` utility
function because it has no effect in this context.
@jdm
Copy link
Contributor

jdm commented Nov 15, 2019

I can't help wondering if we should have different templates for synchronous vs. asynchronous tests, just to avoid so much duplication.

@jugglinmike
Copy link
Contributor Author

I can't help wondering if we should have different templates for synchronous vs. asynchronous tests, just to avoid so much duplication.

I wondered that, too. I decided against it because I saw that the test files are hard-coded, but now I can see that there's a specific provision for this test suite. I'll see what I can do about this...

@jugglinmike
Copy link
Contributor Author

@jdm It looks like using multiple templates will require more effort than extending the list in that script. I won't have the bandwidth to do that any time soon, but I would like to see these tests made technically correct. Would you be willing to tolerate the duplication as technical debt?

@jdm
Copy link
Contributor

jdm commented Nov 15, 2019

Yes, I won't insist on that change when it's holding back actual test correctness issues.

@guest271314
Copy link
Contributor

Note, dce0fc9#diff-8bf796e810f7184850d920e92c11bad2R46 currently will throw an exception at Firefox and Nightly whether the test is synchronous or asynchronous (#19799).

@guest271314
Copy link
Contributor

Note also, the messages printed at https://wpt.fyi/results/offscreen-canvas/the-offscreen-canvas/2d.getcontext.exists.html?diff&filter=ADC&run_id=358480001&run_id=343560004 for Firefox

The 2D context is implemented | NOT_DEFINED(OffscreenCanvas) | NOT_DEFINED(OffscreenCanvas)

and

The 2D context is implemented | FAIL message: OffscreenCanvas is not defined | FAIL message: OffscreenCanvas is not defined

are incorrect. OffscreenCanvas is defined, OffscreenCanvasRenderingContext2D are not defined at Firefox 69 and Nightly 72.

@guest271314
Copy link
Contributor

Is the Firefox version being tested launched with gfx.offscreencanvas.enabled preference set to true?

@guest271314
Copy link
Contributor

Firefox does not implement OffscreenCanvas

Currently Firefox requires the preference gfx.offscreen.enabled to be set to true for OffscreenCanvas to be defined in main thread and Worker scope. Firefox tracking bug https://bugzilla.mozilla.org/show_bug.cgi?id=1390089.

If no preferences were passed to Firefox being used the above quote would be correct and the test re Firefox moot, however, the browser used by WPT does pass custom preferences to the browser instance web-platform-tests/wpt.fyi#1648 (comment). Therefore gfx.offscreen.enabled can be set to true to actually test the current implementation of OffscreenCanvas at Firefox.

@jugglinmike
Copy link
Contributor Author

@guest271314 Thanks, that's all good information. This pull request is focused on correcting the tests themselves, so discussion about configuring the browsers is probably better left to a separate issue.

@jugglinmike
Copy link
Contributor Author

The stability check in Firefox appears to be timing out due to the number of tests modified by this patch. @jdm if you could verify my interpretation, then I will override the warning about the failed job.

@jdm
Copy link
Contributor

jdm commented Nov 27, 2019

Agreed!

@stephenmcgruer stephenmcgruer merged commit b1e4f23 into web-platform-tests:master Dec 3, 2019
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.

[offscreen-canvas] Procedurally-generated tests are invalid
6 participants