-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[testharness.js] Require single-page test opt-in #20036
[testharness.js] Require single-page test opt-in #20036
Conversation
This enacts the change specified by WPT RFC 28. https://github.com/web-platform-tests/rfcs/blob/master/rfcs/single_test.md
@jugglinmike I'll hold off until the tests pass on Azure Piplines and Taskcluster. |
I've updated the relevant "functional" tests. Those could be extended to cover the new harness failure cases, but we're already testing all cases via two different approaches:
And since we've previously agreed that this third format is the most awkward to run and maintain, covering the new functionality yet again seems more like contributing to technical debt than preventing regressions.
My mistake. The current behavior had me thinking that tests always report at least one subtest, but I was forgetting about harness TIMEOUT. It just comes down to calling |
@jugglinmike expectations still have to be updated for some *.any.sharedworker.html tests in Safari, because the failure mode is now different. |
@@ -792,7 +792,10 @@ policies and contribution forms [3]. | |||
|
|||
function done() { | |||
if (tests.tests.length === 0) { | |||
tests.set_file_is_test(); | |||
tests.status.status = tests.status.ERROR; | |||
tests.status.message = "done() was called without first defining any tests"; |
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.
Do any existing tests hit this in Chrome, Firefox or Safari?
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.
My research above includes only Firefox and Chrome, but none of those discrepancies are due to an early done
invocation (at least, not now that we've merged gh-19904).
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
The sort of problem found in #20036 (comment) is what I had hoped to spot before this was merged.
All set, @foolip (GitHub was experiencing technical difficulties when I pushed the latest set of changes, so I needed to push an empty commit in order to trigger CI). |
@jugglinmike merged! It'd be good to compare the results of e09e55a and f15a13d when Taskcluster is finished running both, just to be sure this didn't affect any new tests since the last checking, unlikely as that is. |
Checks comparing before/after results can be found at https://github.com/web-platform-tests/wpt/runs/290180050, and There are affected tests, enough that it seems worth checking carefully. web-platform-tests/wpt.fyi#462 would come in handy, but I think downloading the full reports and grepping in them is the only method I'd trust at this point. @jugglinmike can you check out if any of these changes are unintended? Here's one that makes the failure mode less clear: |
Looks to me like the problem is that |
Ping @jugglinmike, #19993 is blocked on the above because some of the tests will result in |
This enacts the change specified by WPT RFC 28.
https://github.com/web-platform-tests/rfcs/blob/master/rfcs/single_test.md
Overall, this patch appears to be safe to land, though we may want to wait for gh-19904 and gh-20031 before doing so.
In gh-19578, we aimed to extend all of WPT's single-page tests with the new implicit opt-in pattern. Once we completed that, I created this patch and ran it in Chrome Dev and Firefox Nightly.
Most of the discrepancies are due to flaky tests (listed below). The second most common cause comes from references to the API under test outside of a subtest (also listed below). In
master
today, the resultingReferenceError
causes the test to be reported as a failing single-page test, even though in most cases, it was authored to define multiple sub-tests. The new result is a harness error, and that's more appropriate for these cases.There are a handful of tests whose results changed for other reasons:
WebCryptoAPI/derive_bits_keys/
IndexedDB/structured-clone.any.html
IndexedDB/structured-clone.any.worker.html
fetch/metadata/sec-fetch-dest/redirect/multiple-redirect-https-downgrade-upgrade.tentative.sub.html
fetch/metadata/sec-fetch-dest/redirect/redirect-http-upgrade.tentative.sub.html
fetch/metadata/sec-fetch-dest/redirect/redirect-https-downgrade.tentative.sub.html
-idle-detection/interceptor.https.html
infrastructure/expected-fail/uncaught-exception.html
infrastructure/expected-fail/unhandled-rejection.html
preload/preload-csp.sub.html
preload/preload-default-csp.sub.html
flaky tests
background-fetch/
content-security-policy/
css/
- flakyhtml/semantics/links/links-created-by-a-and-area-elements/
intersection-observer/cross-origin-iframe.sub.html
longtask-timing/longtask-in-sibling-iframe-crossorigin.html
offscreen-canvas/
scroll-to-text-fragment/scroll-to-text-fragment.html
webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html
webmessaging/broadcastchannel/basics.html
webmessaging/broadcastchannel/workers.html
css/css-animations/CSSAnimation-startTime.tentative.html
css/css-backgrounds/background-334.html
css/css-multicol/animation/column-rule-color-interpolation.html
css/css-properties-values-api/property-cascade.html
css/css-transitions/events-007.html
css/css-writing-modes/text-combine-upright-parsing-valid-001.html
html/cross-origin-embedder-policy/require-corp.https.html
html/semantics/scripting-1/the-script-element/load-error-events-3.html
html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-1.html
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/abort-refresh-immediate.window.html
offscreen-canvas/the-offscreen-canvas/offscreencanvas.commit.w.html
performance-timeline/case-sensitivity.any.html
pointerevents/pointerevent_setpointercapture_inactive_button_mouse.html
referrer-policy/gen/req.attr/same-origin/img-tag/cross-https.swap-origin.http.html
resource-timing/resource_connection_reuse.html
resource-timing/resource_timing_buffer_full_eventually.html
service-workers/service-worker/ready.https.html
upgrade-insecure-requests/gen/worker-classic-data.meta/upgrade/fetch/cross-http-downgrade.downgrade.https.html
webaudio/the-audio-api/the-scriptprocessornode-interface/simple-input-output.html
webdriver/
webvtt/
unsafe API references
streams/readable-byte-streams/construct-byob-request.any.html
streams/readable-byte-streams/construct-byob-request.any.serviceworker.html
streams/readable-byte-streams/construct-byob-request.any.sharedworker.html
streams/readable-byte-streams/construct-byob-request.any.worker.html
trusted-types/
2dcontext/wide-gamut-canvas/imageData-colorManagedBehavior.html
animation-worklet/worklet-animation-pause.https.html
animation-worklet/worklet-animation-without-target.https.html
css/css-properties-values-api/conditional-rules.html
css/css-properties-values-api/unit-cycles.html
css/css-properties-values-api/url-resolution.html
css/css-typed-om/
custom-elements/form-associated/ElementInternals-accessibility.html
custom-elements/form-associated/form-associated-callback.html
encoding/streams/decode-utf8.any.serviceworker.html
encoding/streams/realms.window.html
streams/piping/pipe-through.any.serviceworker.html
streams/readable-byte-streams/construct-byob-request.any.html
streams/readable-byte-streams/construct-byob-request.any.serviceworker.html
streams/readable-byte-streams/construct-byob-request.any.worker.html
streams/transform-streams/brand-checks.any.html
streams/transform-streams/brand-checks.any.serviceworker.html
streams/transform-streams/brand-checks.any.worker.html
streams/transform-streams/properties.any.serviceworker.html
streams/writable-streams/brand-checks.any.html
streams/writable-streams/brand-checks.any.serviceworker.html
streams/writable-streams/brand-checks.any.worker.html
streams/writable-streams/properties.any.serviceworker.html
trusted-types/GlobalEventHandlers-onclick.tentative.html
trusted-types/Node-multiple-arguments.tentative.html
trusted-types/TrustedTypePolicyFactory-metadata.tentative.html
trusted-types/WorkerGlobalScope-importScripts.https.html
trusted-types/block-Node-multiple-arguments.tentative.html
trusted-types/block-eval.tentative.html
trusted-types/block-string-assignment-to-Document-write.tentative.html
trusted-types/block-string-assignment-to-Element-setAttribute.tentative.html
trusted-types/eval-with-permissive-csp.tentative.html
trusted-types/trusted-types-eval-reporting-no-unsafe-eval.tentative.https.html
trusted-types/trusted-types-eval-reporting-report-only.tentative.https.html
trusted-types/trusted-types-eval-reporting.tentative.https.html
trusted-types/trusted-types-report-only.tentative.https.html
trusted-types/trusted-types-reporting-check-report.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworklet-messageport.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworklet-postmessage-sharedarraybuffer.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworkletglobalscope-sample-rate.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworkletglobalscope-timing-info.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-onerror.https.html
webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-output-channel-count.https.html
webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/cors-check.https.html
webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/no-cors.https.html