Skip to content

Fix mach test-wpt to make crash tests work - #29832

Merged
mukilan merged 5 commits into
servo:masterfrom
mukilan:fix-crashtests
Aug 19, 2023
Merged

mukilan merged 5 commits into
servo:masterfrom
mukilan:fix-crashtests

Conversation

@mukilan

@mukilan mukilan commented Jun 2, 2023 •

Copy link
Copy Markdown
Member

The first commit fixes two issues related to crash tests:

  1. test-wpt is unable to find existing crash tests even when called with --test-types=crashtests. The fix here is to add crashtests to the default test suite types to python/wpt/run.py
  2. When running in headless mode, crashes in style threads don't cause servo to crash because the logic in constellation.rs currently calls handle_panic only when the top-level browsing context id is some value. Since style pool threads are shared, they always generate Panic messages with None as top-level browsing context id.

The second commit addresses issues with generating and capturing backtrace and stderr for crash tests.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

@mukilan
mukilan requested a review from mrobinson June 2, 2023 12:33
@mukilan

mukilan commented Jun 2, 2023

Copy link
Copy Markdown
Member Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit bd94242 with merge 08f2d99...

bors-servo added a commit that referenced this pull request Jun 2, 2023
Fix `mach test-wpt` to make crash tests work

There are two issues related to crash tests:
1. test-wpt is unable to find existing crash tests even when called with --test-types=crashtests. The fix here is to add crashtests to the default test suite types to python/wpt/run.py
2. When running in headless mode, crashes in style threads don't cause servo to crash because the logic in constellation.rs currently calls handle_panic only when the top-level browsing context id is some value. Since style pool threads are shared, they always generate Panic messages with None as top-level browsing context id.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they fix bugs in testing logic

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@github-actions

github-actions Bot commented Jun 2, 2023

Copy link
Copy Markdown

Test results for linux-wpt-layout-2020 from try job (#5155522379):

Flaky unexpected result (1)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue. assert_true: expected true got false
Stable unexpected results that are known to be intermittent (1)
  • PASS [expected FAIL] /_mozilla/mozilla/simple_scroll_to_fragment.html (#14606)
Stable unexpected results (3)
  • TIMEOUT [expected PASS] /css/css-flexbox/inline-flexbox-absurd-block-size-crash.html
  • TIMEOUT [expected PASS] /css/css-position/overlay/overlay-popover-backdrop-crash.html
  • TIMEOUT [expected PASS] /css/filter-effects/crashtests/broken-reference-crash-001.html

@github-actions

github-actions Bot commented Jun 2, 2023

Copy link
Copy Markdown

Test results for linux-wpt-layout-2013 from try job (#5155522379):

Flaky unexpected result (9)
  • OK /_mozilla/css/stylesheet_media_queries.html (#17159)
    • FAIL [expected PASS] subtest: Media queries within stylesheets assert_equals: expected "rgb(0, 255, 0)" but got "rgb(255, 0, 0)"
  • CRASH [expected OK] /_mozilla/mozilla/service-workers/service-worker-registration.https.html
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected FAIL] /css/css-backgrounds/background-size/vector/tall--auto-32px--nonpercent-width-omitted-height.html
  • OK /fetch/local-network-access/worker-blob-fetch.window.html (#29602)
    • FAIL [expected PASS] subtest: local https to local https: success. assert_equals: fetch error expected (undefined) undefined but got (string) "unknown error"
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • PASS [expected FAIL] subtest: The document for a standalone media file should have one child in the body.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used Test timed out
  • TIMEOUT [expected OK] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • TIMEOUT [expected PASS] subtest: reparent-form-during-planned-navigation-task Test timed out
  • OK [expected TIMEOUT] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
Stable unexpected results that are known to be intermittent (22)
  • OK /css/CSS2/linebox/inline-negative-margin-001.html (#23862)
    • FAIL [expected PASS] subtest: [data-expected-height] 1 assert_equals:
      <inline-block data-expected-height="10">123 <span style="margin-left: -8ch">1234 </span></inline-block>
      height expected 10 but got 20
    • FAIL [expected PASS] subtest: [data-expected-height] 2 assert_equals:
      <inline-block data-expected-height="10">123 <span style="margin-left: -8ch">123 </span></inline-block>
      height expected 10 but got 20
    • PASS [expected FAIL] subtest: [data-expected-height] 4
  • OK [expected TIMEOUT] /fetch/local-network-access/iframe.tentative.https.window.html (#29605)
    • FAIL [expected TIMEOUT] subtest: public to local, grandparent navigates: failure. timeout adding grandchild
    • FAIL [expected TIMEOUT] subtest: public to local, grandparent navigates: success. timeout adding grandchild
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-site - HTTPS downgrade (header not sent) Test timed out
  • TIMEOUT [expected ERROR] /html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html (#28541)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • FAIL [expected PASS] subtest: Same-origin navigation started from unload handler must be ignored assert_equals: expected "?pass" but got "?fail"
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • FAIL [expected TIMEOUT] subtest: <dialog>-contained autofocus element gets focused when the dialog is shown promise_test: Unhandled rejection with value: object "TypeError: w.document.querySelector(...).show is not a function"
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • FAIL [expected TIMEOUT] subtest: Element with tabindex should support autofocus assert_equals: expected "SPAN" but got "BODY"
    • PASS [expected NOTRUN] subtest: Non-HTMLElement should not support autofocus
    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus should support autofocus promise_test: Unhandled rejection with value: object "TypeError: host.attachShadow is not a function"
    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus including no focusable descendants should be skipped promise_test: Unhandled rejection with value: object "TypeError: host.attachShadow is not a function"
    • FAIL [expected NOTRUN] subtest: Area element should support autofocus promise_test: Unhandled rejection with value: object "TypeError: w.document.querySelector(...) is null"
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • FAIL [expected TIMEOUT] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks w.focus is not a function
  • OK /html/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
    • PASS [expected FAIL] subtest: Video should seek to time specified in media fragment syntax
  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • FAIL [expected PASS] subtest: multipart/form-data: 0x00 in name (normal form) assert_equals: expected "\r\nContent-Disposition: form-data; name="a\0b"\r\n\r\nc\r\n--\r\n" but got ""
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • FAIL [expected PASS] subtest: The end: DOMContentLoaded and defer scripts assert_false: DOMContentLoaded should not have fired before executing a task queued from a defer script expected false got true
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html (#26243)
    • PASS [expected FAIL] subtest: document.write in an imported module
  • TIMEOUT /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry.html (#25805)
  • OK [expected TIMEOUT] /webmessaging/with-ports/018.html (#24485)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, javascript:
  • OK [expected TIMEOUT] /webmessaging/without-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe
  • ERROR [expected OK] /workers/constructors/Worker/Worker-constructor.html (#22991)
  • OK /workers/dedicated-worker-from-blob-url.window.html (#22286)
    • FAIL [expected PASS] subtest: Creating a dedicated worker from a blob URL works immediately before revoking. promise_test: Unhandled rejection with value: object "[object Event]"
Stable unexpected results (12)
  • TIMEOUT [expected PASS] /css/css-flexbox/contain-size-layout-abspos-flex-container-crash.html
  • TIMEOUT [expected PASS] /css/css-position/overlay/overlay-popover-backdrop-crash.html
  • TIMEOUT [expected PASS] /css/css-text/ellisize-rtl-text-crash.html
  • TIMEOUT [expected PASS] /css/cssom-view/client-props-root-display-none-crash.html
  • TIMEOUT [expected PASS] /css/filter-effects/crashtests/broken-reference-crash-001.html
  • CRASH [expected PASS] /custom-elements/when-defined-reentry-crash.html
  • TIMEOUT [expected PASS] /fullscreen/crashtests/chrome-1312699.html
  • CRASH [expected PASS] /html/semantics/forms/the-input-element/input-form-detach-style-crash.html
  • TIMEOUT [expected PASS] /html/semantics/popovers/popover-dialog-crash.html
  • TIMEOUT [expected PASS] /html/semantics/popovers/popover-hint-crash.tentative.html
  • TIMEOUT [expected PASS] /html/semantics/popovers/popover-manual-crash.html
  • TIMEOUT [expected PASS] /streams/readable-streams/crashtests/strategy-worker-terminate.html

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-github

@mukilan
mukilan marked this pull request as draft June 2, 2023 15:03
@mrobinson

Copy link
Copy Markdown
Member

Hrm. It seems like this is causing more timeouts. I wonder what could be preventing the process from exiting in these tests...

bors-servo added a commit that referenced this pull request Jun 3, 2023
Clear PositioningContext for speculative layouts

<!-- Please describe your changes on the following line: -->
Developed in collaboration with @mrobinson

`try_layout` is used for laying out absolutely positioned descendants multiple times when min/max-{width, height} properties are set. When the same PositioningContext instance is used between successive attempts without clearing the accumulated descendants, we will generate multiple fragments which reference the same box, which then will lead to a double borrow error when layout is performed in parallel.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because crash testing is currently not working in servo. New tests will be added once #29832 is fixed.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@mukilan
mukilan marked this pull request as ready for review August 17, 2023 14:06
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#41513) with upstreamable changes.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#41513) title and body.

@mukilan

mukilan commented Aug 17, 2023

Copy link
Copy Markdown
Member Author

@bors-servo try

@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#5892033956) with platform=all and layout=all

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt-layout-2013 from try job (#5892033956):

Flaky unexpected result (12)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-text/white-space/trailing-space-position-001.html (#24585)
    • FAIL [expected PASS] subtest: CSS Test: Positions of trailing collapsible spaces 4 assert_equals: expected 0 but got -0
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • FAIL [expected PASS] subtest: Same-origin navigation started from unload handler must be ignored assert_equals: expected "?pass" but got "?fail"
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped Test timed out
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • TIMEOUT [expected OK] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • TIMEOUT [expected PASS] subtest: reparent-form-during-planned-navigation-task Test timed out
  • ERROR /resource-timing/content-type-parsing.html (#29131)
    • FAIL [expected TIMEOUT] subtest: mime-type 16 : text/html;charset=�gbk assert_equals: expected (string) "text/html" but got (undefined) undefined
    • TIMEOUT [expected NOTRUN] subtest: mime-type 17 : text/html;charset= gbk Test timed out
  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
  • OK [expected ERROR] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results that are known to be intermittent (13)

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt-layout-2020 from try job (#5892033956):

Flaky unexpected result (8)
Stable unexpected results that are known to be intermittent (32)
Stable unexpected results (1)
  • CRASH [expected PASS] /streams/readable-streams/crashtests/strategy-worker-terminate.html

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#5892033956) failed.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

mukilan and others added 4 commits August 18, 2023 13:23
There are two issues related to crash tests:
1. test-wpt is unable to find existing crash tests even when
   called with --test-types=crashtests. The fix here is to
   add crashtests to the default test suite types to python/wpt/run.py
2. When running in headless mode, crashes in style threads
   don't cause servo to crash because the logic in constellation.rs
   currently calls handle_panic only when the top-level browsing
   context id is some value. Since style pool threads are shared,
   they always generate Panic messages with None as top-level
   browsing context id.

Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
Servo's panic hook writes backtraces to stdout. This
patch changes it so they are written to stderr.

The crash test executor for servo in WPT grouping formatter
was also not capturing the output correctly for crashtests
as the log events were being aggregated based on thread name
which doesn't seem to match correctly in case of crashtests.
This patch also fixes the log grouping logic to be based on
test name.

Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#41513).

@mrobinson
mrobinson enabled auto-merge August 18, 2023 07:58
@mrobinson
mrobinson added this pull request to the merge queue Aug 18, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2023
@mrobinson

Copy link
Copy Markdown
Member

Looks like the two failures are:

  • PASS [expected CRASH] /custom-elements/when-defined-reentry-crash.html (2013 / 2020)
  • PASS [expected CRASH] /streams/readable-streams/crashtests/strategy-worker-terminate.html (2020)

The first was recently fixed, so I think we can remove that expectation. The second must be a flaky crash. For that I guess we simply need to remove the expectation and open an I-Intermittent bug to track it.

@mukilan

mukilan commented Aug 18, 2023

Copy link
Copy Markdown
Member Author

Thanks @mrobinson! I've removed the expectations for those tests and repurposed #30124 to track the intermittent CRASH

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#41513).

@mukilan
mukilan enabled auto-merge August 18, 2023 09:42
@mukilan
mukilan added this pull request to the merge queue Aug 18, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2023
@mrobinson

Copy link
Copy Markdown
Member

I suspect that this failure in the float unit tests is unrelated to this change. The float unit tests use quickcheck to essentially "fuzz" the float layout algorithm. Sometimes the values passed stretch the limits of our floating point layout in Layout 2020 (see #29819). To confirm, I'm going to send this back to the MQ to see if this behavior is flaky.

@mrobinson
mrobinson added this pull request to the merge queue Aug 18, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 18, 2023
@mukilan
mukilan added this pull request to the merge queue Aug 18, 2023
Merged via the queue into servo:master with commit 33fa49c Aug 19, 2023
@mukilan
mukilan deleted the fix-crashtests branch August 19, 2023 00:56
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.

5 participants