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

script: Start replacing time with std::time and chrono #30639

Merged
merged 15 commits into from Jan 16, 2024

Conversation

augustebaum
Copy link
Contributor

@augustebaum augustebaum commented Oct 28, 2023

This change is intended to be reviewed commit-by-commit.

Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Nicely done! I have a few comments below, but generally speaking this looks great.

components/script/dom/globalscope.rs Outdated Show resolved Hide resolved
components/script/dom/htmlmediaelement.rs Outdated Show resolved Hide resolved
Comment on lines 771 to 773
let dur = SystemTime::now()
.duration_since(start.get().unwrap())
.unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

I think we should try to not panic here, so please provide defaults if we cannot unwrap successfully.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the last unwrap to unwrap_or_default, for lack of a smarter solution.

Comment on lines 778 to 780
let dur = SystemTime::now()
.duration_since(start.get().unwrap())
.unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

The same comment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

components/script/script_thread.rs Show resolved Hide resolved
@@ -258,7 +261,7 @@ impl InProgressLoad {
is_visible: true,
url: url,
origin: origin,
navigation_start: (current_time.sec * 1000 + current_time.nsec as i64 / 1000000) as u64,
navigation_start: navigation_start,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
navigation_start: navigation_start,
navigation_start,

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 contemplated doing this but it seems this would be better dealt with in a big fmt change.

Copy link
Member

Choose a reason for hiding this comment

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

We could enforce it with use_field_init_shorthand.

components/script/script_thread.rs Outdated Show resolved Hide resolved
@augustebaum
Copy link
Contributor Author

augustebaum commented Oct 29, 2023

I'm nearly done; only have script/dom/htmlformelement.rs left, but I'm getting a gnarly compilation error. See this chat entry. Would appreciate any support!

EDIT: Immediately after commenting I got an answer on Zulip, which allowed me to get a solution that compiles; however, I will put in a bit more work to potentially get a more robust solution that doesn't involve NoTrace.

EDIT: Seems like the NoTrace solution might work. Thanks @sagudev!

@mrobinson mrobinson added this pull request to the merge queue Oct 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@mrobinson mrobinson added this pull request to the merge queue Oct 30, 2023
@mrobinson
Copy link
Member

Looks like this is a flake in the float tests...frustrating and they should probably be switched away from a fuzzing approach to a traditional test framework. I'm resending this to the MQ.

@augustebaum
Copy link
Contributor Author

@mrobinson Thanks for the review! Please consider resolving the above conversations as I'm interested in your opinion on these.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2023
@mrobinson
Copy link
Member

It seems that some animation and performance tests are failing, likely because the new code is returning different results that the old code. One way to debug this is to compare the two times (via the old APIs and the new ones) via print statements to see where they are different.

Failures:

components/script/animation_timeline.rs Outdated Show resolved Hide resolved
components/script/animation_timeline.rs Outdated Show resolved Hide resolved
@mrobinson mrobinson added the T-full Do a full try run label Nov 3, 2023
@github-actions github-actions bot removed the T-full Do a full try run label Nov 3, 2023
Copy link

github-actions bot commented Nov 3, 2023

🔨 Triggering try run (#6747135167) with platforms=linux,macos,windows and layout=all

Copy link

github-actions bot commented Nov 3, 2023

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

Flaky unexpected result (20)
  • 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
  • TIMEOUT [expected OK] /_webgl/conformance2/glsl3/compound-assignment-type-combination.html
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected PASS] /css/CSS2/floats/floats-placement-vertical-004-ref.xht
  • TIMEOUT [expected PASS] /css/CSS2/margin-padding-clear/margin-008.xht
  • TIMEOUT [expected FAIL] /css/css-position/sticky/position-sticky-contained-by-display-table.html
  • OK /css/cssom-view/elementFromPoint-list-001.html (#23915)
    • FAIL [expected PASS] subtest: <li>Outside 3</li> assert_equals: expected Element node <li>Outside 3</li> but got Element node <li class="image">Image Outside 1</li>
    • FAIL [expected PASS] subtest: <li>Image Outside 2</li> assert_equals: expected Element node <li class="image">Image Outside 2</li> but got Element node <ul>
      <li>Outside 1</li>
      <li>Outside 2</li>
      <l...
  • OK /css/cssom-view/offsetTopLeft-border-box.html (#24237)
    • FAIL [expected PASS] subtest: container: 0 assert_equals: offsetTop expected 2 but got 0
    • FAIL [expected PASS] subtest: container: 1 assert_equals: offsetTop expected 2 but got 0
  • TIMEOUT /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.html (#29055)
    • TIMEOUT [expected PASS] subtest: Navigating an opened window via location.href to a javascript: URL must not fire beforeunload: undefined completion Test timed out
    • NOTRUN [expected FAIL] subtest: Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe: undefined completion
    • NOTRUN [expected PASS] subtest: Navigating an iframe via location.href to a javascript: URL must not fire beforeunload: string completion
    • NOTRUN [expected PASS] subtest: Navigating an iframe via src="" to a javascript: URL after insertion must not fire beforeunload: string completion
    • NOTRUN [expected TIMEOUT] subtest: Navigating an opened window via location.href to a javascript: URL must not fire beforeunload: string completion
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • CRASH [expected PASS] /html/canvas/element/manual/drawing-text-to-the-canvas/canvas.2d.disconnected-font-size-math.html (#30063)
  • CRASH [expected OK] /html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.html (#30164)
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-static-import-delayed.html (#26243)
    • FAIL [expected PASS] subtest: document.write in an imported module assert_true: onload must be called expected true got false
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-tla-delayed.html (#29137)
    • FAIL [expected PASS] subtest: document.write in an imported module assert_true: onload must be called expected true got false
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • PASS [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document
  • TIMEOUT [expected OK] /wasm/jsapi/functions/entry.html (#27087)
    • TIMEOUT [expected FAIL] subtest: Sanity check: this all works as expected synchronously Test timed out
  • OK [expected TIMEOUT] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
  • 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 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
Stable unexpected results that are known to be intermittent (21)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • 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/CSS2/linebox/inline-negative-margin-001.html (#23862)
    • PASS [expected FAIL] subtest: [data-expected-height] 1
    • PASS [expected FAIL] subtest: [data-expected-height] 2
    • FAIL [expected PASS] subtest: [data-expected-height] 4 assert_equals:
      <div class="w4" data-expected-height="10">123 <span style="margin-left: -4ch">123 </span></div>
      height expected 10 but got 20
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected TIMEOUT] subtest: background-image sec-fetch-mode - Not sent to non-trustworthy same-origin destination
    • PASS [expected TIMEOUT] subtest: background-image sec-fetch-site - HTTPS downgrade (header not sent)
    • PASS [expected FAIL] subtest: border-image sec-fetch-site - HTTPS downgrade (header not sent)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html (#28066)
    • PASS [expected FAIL] subtest: D83D DE0D set in href="" targeting a frame and clicked
    • PASS [expected FAIL] subtest: DE0D 0041 set in href="" targeting a frame and clicked
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • 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 [expected TIMEOUT] /html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html (#29738)
    • FAIL [expected TIMEOUT] subtest: grandparent cancels a pending navigation in a cross-origin grandchild assert_false: Grandchild <iframe>'s load event does not fire before its parent's load event and grandparent's load event expected false got true
  • OK [expected TIMEOUT] /html/browsers/origin/cross-origin-objects/cross-origin-objects.html (#28569)
  • FAIL [expected CRASH] /html/canvas/element/manual/text/canvas.2d.disconnected.html (#30063)
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • PASS [expected FAIL] subtest: createHTMLDocument
    • PASS [expected FAIL] subtest: <template>
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • PASS [expected FAIL] subtest: multipart/form-data: 0x00 in name (formdata event)
    • PASS [expected FAIL] subtest: multipart/form-data: single quote in name (normal form)
    • PASS [expected FAIL] subtest: multipart/form-data: backslash in value (normal form)
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • FAIL [expected PASS] subtest: text/plain: 0x00 in name (normal form) assert_equals: expected "a\0b=c\r\n" but got ""
    • FAIL [expected PASS] subtest: text/plain: double quote in name (formdata event) assert_equals: expected "a"b=c\r\n" but got ""
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • OK [expected TIMEOUT] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
  • ERROR /resource-timing/content-type-parsing.html (#29131)
    • TIMEOUT [expected FAIL] subtest: mime-type 16 : text/html;charset=�gbk Test timed out
    • NOTRUN [expected TIMEOUT] subtest: mime-type 17 : text/html;charset= gbk
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_greater_than_equal: startTime is after the script to initiate the load ran expected a number greater than or equal to 16747717000439 but got 976917237061
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_greater_than_equal: startTime is after the script to initiate the load ran expected a number greater than or equal to 16747717036804.9 but got 586871216662
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
Stable unexpected results (7)
  • PASS [expected FAIL] /_mozilla/css/inline_block_baseline_a.html
  • OK /_webgl/conformance/glsl/misc/shader-varying-packing-restrictions.html
    • FAIL [expected PASS] subtest: WebGL test Bind harfbuzz #4: [unexpected link status] shaders with one more than the maximum number of varyings of float should fail assert_true: [unexpected link status] shaders with one more than the maximum number of varyings of float should fail expected true got false
    • FAIL [expected PASS] subtest: WebGL test Fixed an html-parsing crash caused by refactor #10: [unexpected link status] shaders with one more than the maximum number of varyings of vec2 should fail assert_true: [unexpected link status] shaders with one more than the maximum number of varyings of vec2 should fail expected true got false
    • FAIL [expected PASS] subtest: WebGL test Fail to build on Mac OS X 10.7 #22: [unexpected link status] shaders with one more than the maximum number of varyings of vec4 should fail assert_true: [unexpected link status] shaders with one more than the maximum number of varyings of vec4 should fail expected true got false
  • CRASH [expected PASS] /css/css-fonts/infinite-size-crash.html
  • OK /dom/events/Event-timestamp-safe-resolution.html
    • FAIL [expected PASS] subtest: Event timestamp should not have a resolution better than 5 microseconds assert_greater_than_equal: expected a number greater than or equal to 5 but got 1
  • OK /html/dom/render-blocking/parser-blocking-script.tentative.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16747717049739.53 but got 1150.56
  • OK /html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16747717096271.46 but got 1200.04
  • OK /workers/worker-performance.worker.html
    • FAIL [expected PASS] subtest: Resource timing seems to work in workers assert_greater_than_equal: Resource entry startTime is after a time before it expected a number greater than or equal to 16747717118845.09 but got 847835408366

Copy link

github-actions bot commented Nov 3, 2023

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

Flaky unexpected result (17)
  • FAIL [expected PASS] /_mozilla/css/iframe/hide_and_show.html (#15265)
  • 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
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • 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
  • TIMEOUT [expected OK] /css/selectors/media/media-playback-state.html
    • TIMEOUT [expected FAIL] subtest: Test :seeking pseudo-class Test timed out
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals from the same task
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK [expected TIMEOUT] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • PASS [expected TIMEOUT] subtest: reparent-form-during-planned-navigation-task
  • OK /html/semantics/forms/historical.html (#28568)
    • PASS [expected FAIL] subtest: <input name=isindex> should not be supported
  • OK /html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html (#23205)
    • FAIL [expected PASS] subtest: Check that rel=noopener with target=_self does a normal load this.openedWindow.findLink is not a function
  • OK [expected TIMEOUT] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
  • TIMEOUT [expected OK] /webmessaging/without-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank Test timed out
Stable unexpected results that are known to be intermittent (14)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/linebox/inline-negative-margin-001.html (#23862)
    • PASS [expected FAIL] subtest: [data-expected-height] 9
    • PASS [expected FAIL] subtest: [data-expected-height] 10
    • PASS [expected FAIL] subtest: [data-expected-height] 11
    • PASS [expected FAIL] subtest: [data-expected-height] 12
    • PASS [expected FAIL] subtest: [data-expected-height] 13
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-weight: '400' should prefer '500' over '350 399'
    • PASS [expected FAIL] subtest: Matching font-weight: '400' should prefer '350 399' over '351 398'
    • PASS [expected FAIL] subtest: Matching font-weight: '430' should prefer '500' over '400 425'
    • FAIL [expected PASS] subtest: Matching font-weight: '501' should prefer '501' over '502 510' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '399' should prefer '200 300' over '400' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '110% 120%' over '115% 116%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '110% 120%' over '115% 116%' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-stretch: '110%' should prefer '115% 116%' over '105%'
    • PASS [expected FAIL] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%'
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • And 17 more unexpected results...
  • FAIL [expected PASS] /css/css-text/line-breaking/segment-break-transformation-unremovable-2.html (#28758)
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected TIMEOUT] subtest: background-image sec-fetch-mode - Not sent to non-trustworthy same-site destination
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • FAIL [expected PASS] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
  • 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='about:blank' assert_unreached: load should not be fired Reached unreachable code
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • FAIL [expected PASS] subtest: load event does not fire on window.open('about:blank') assert_unreached: load should not be fired Reached unreachable code
  • OK [expected TIMEOUT] /html/browsers/origin/cross-origin-objects/cross-origin-objects.html (#28569)
  • OK [expected TIMEOUT] /html/canvas/element/pixel-manipulation/2d.imageData.get.large.crash.html (#29086)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_greater_than_equal: startTime is after the script to initiate the load ran expected a number greater than or equal to 16747716617556.12 but got 1179193993436
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_greater_than_equal: startTime is after the script to initiate the load ran expected a number greater than or equal to 16747716972980.4 but got 598474312535
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
Stable unexpected results (4)
  • OK /dom/events/Event-timestamp-safe-resolution.html
    • FAIL [expected PASS] subtest: Event timestamp should not have a resolution better than 5 microseconds assert_greater_than_equal: expected a number greater than or equal to 5 but got 1
  • OK /html/dom/render-blocking/parser-blocking-script.tentative.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16747716631519.86 but got 1278.63
  • OK /html/dom/render-blocking/remove-attr-script-keeps-blocking.tentative.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16747716813400.46 but got 1196.53
  • OK /workers/worker-performance.worker.html
    • FAIL [expected PASS] subtest: Resource timing seems to work in workers assert_greater_than_equal: Resource entry startTime is after a time before it expected a number greater than or equal to 16747717063786.62 but got 1396816112370

@augustebaum
Copy link
Contributor Author

Some of these test failures might be linked to the fact that std::time::SystemTime is not necessarily monotonic. Will need to investigate this...

@sagudev
Copy link
Member

sagudev commented Nov 3, 2023

Where possible use https://doc.rust-lang.org/std/time/struct.Instant.html

@mrobinson
Copy link
Member

The new set of results looks a lot better! I think this is getting quite close. I would also rebase this as at least one of these failures should be fixed in the latest from the main branch.

@augustebaum
Copy link
Contributor Author

I'm reworking the changes and there is something I find strange.

The console_timers attribute takes u64 as values:

console_timers: DomRefCell<HashMap<DOMString, u64>>,

The first time they're used it's to put in a timestamp:

entry.insert(timestamp_ms());

whereas the second time it's to put in the elapsed time since the timestamp:

.map(|start| timestamp_ms() - start)

Ideally console_timers would hold Durations, but that doesn't fit with its first usage where Instant would be more fitting. I'll keep using u64 but this inconsistency might bite someone down the line and should be dealt with.

Copy link

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

Flaky unexpected result (10)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • 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
  • TIMEOUT [expected PASS] /css/css-color/animation/opacity-animation-ending-correctly-002.html (#29216)
  • TIMEOUT [expected PASS] /css/css-fonts/font-size-adjust-reload.html (#30678)
  • FAIL [expected PASS] /css/css-position/position-absolute-iframe-print-001.sub.html
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • PASS [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • FAIL [expected PASS] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation assert_equals: expected "" but got "#fragment"
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 1 (expected array [6, 3] got [6, 1])
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
Stable unexpected results that are known to be intermittent (14)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-weight: '400' should prefer '350 399' over '351 398'
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-weight: '430' should prefer '350 399' over '340 398'
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '400' over '350 399' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-stretch: '100%' should prefer '110% 120%' over '115% 116%'
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 21deg' should prefer 'oblique 20deg' over 'oblique 10deg'
    • And 5 more unexpected results...
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.html (#31025)
  • 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
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • FAIL [expected PASS] subtest: <a> tag navigate fails for unparseable URLs promise_test: Unhandled rejection with value: object "Error: Navigation was attempted to unparseable URL"
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • PASS [expected FAIL] subtest: first argument: absolute url
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • FAIL [expected PASS] subtest: application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got ""
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • FAIL [expected PASS] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document assert_equals: expected "/html/webappapis/scripting/events/resources/open-window.html" but got "blank"
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 14690816 but got 14691072
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 6840320 but got 6840064
  • OK [expected ERROR] /workers/semantics/run-a-worker/003.html (#22765)
Stable unexpected results (3)
  • OK /dom/events/Event-timestamp-safe-resolution.html
    • FAIL [expected PASS] subtest: Event timestamp should not have a resolution better than 5 microseconds assert_greater_than_equal: expected a number greater than or equal to 5 but got 1
  • OK /html/dom/render-blocking/parser-blocking-script.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16741406936406.74 but got 1154.51
  • OK /html/dom/render-blocking/remove-attr-script-keeps-blocking.html
    • FAIL [expected PASS] subtest: Rendering is blocked before render-blocking resources are loaded assert_greater_than: first-paint should occur after loading render-blocking resources expected a number greater than 16741406903878.25 but got 1240.25

Copy link

⚠️ Try run (#7531522298) failed.

@mrobinson
Copy link
Member

Looks like there is at least one more issue to address.

augustebaum and others added 15 commits January 16, 2024 09:45
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
….rs`

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
Use Instant a bit more and stop using chrono. Do not transition
`navigation_start_precise` to Instant yet as we need to coordinate this
across all crates.
@mrobinson mrobinson added the T-linux-wpt-2020 Do a try run of the WPT label Jan 16, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Jan 16, 2024
Copy link

🔨 Triggering try run (#7540553241) with platforms=linux and layout=undefined

Copy link

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

Flaky unexpected result (17)
  • CRASH [expected PASS] /_mozilla/css/img_dynamic_remove.html (#16115)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • 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/cssom-view/MediaQueryList-addListener-handleEvent.html (#24571)
    • FAIL [expected PASS] subtest: looks up handleEvent method on every event dispatch assert_equals: expected 2 but got 1
  • 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 OK] /html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html (#29084)
    • TIMEOUT [expected FAIL] subtest: changing srcdoc to about:srcdoc#yo then another srcdoc does two push navigations and we can navigate back Test timed out
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • PASS [expected FAIL] subtest: Check execution order on load handler
    • PASS [expected FAIL] subtest: Check execution order from nested timeout
  • OK /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html (#28066)
    • FAIL [expected PASS] subtest: 0041 set in href="" targeting a frame and clicked assert_equals: expected "A" but got ""
    • FAIL [expected PASS] subtest: 0080 00FF set in href="" targeting a frame and clicked assert_equals: expected "�ÿ" but got ""
    • FAIL [expected PASS] subtest: 0080 00FF 0100 set in href="" targeting a frame and clicked assert_equals: expected "�ÿĀ" but got ""
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • PASS [expected FAIL] subtest: first argument: absolute url
  • OK [expected TIMEOUT] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • OK /html/interaction/focus/the-autofocus-attribute/document-with-fragment-valid.html (#28259)
    • PASS [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with URL fragments should be skipped.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • 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
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • PASS [expected FAIL] subtest: The end: DOMContentLoaded and defer scripts
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe Test timed out
Stable unexpected results that are known to be intermittent (12)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '400' over '350 399' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-weight: '399' should prefer '450 460' over '500 501'
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-stretch: '100%' should prefer '110% 120%' over '115% 116%'
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-stretch: '110%' should prefer '50% 80%' over '60% 70%'
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • And 5 more unexpected results...
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • PASS [expected FAIL] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.html (#31025)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • TIMEOUT [expected FAIL] subtest: location.href setter throws a SyntaxError DOMException for unparseable URLs Test timed out
    • NOTRUN [expected PASS] subtest: <a> tag navigate fails for unparseable URLs
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 2 (expected array [6, 3] got [6, 2])
  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • FAIL [expected PASS] subtest: application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got ""
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • FAIL [expected PASS] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document assert_equals: expected "/html/webappapis/scripting/events/resources/open-window.html" but got "blank"
  • TIMEOUT [expected OK] /webmessaging/without-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank Test timed out
  • OK [expected ERROR] /workers/semantics/run-a-worker/003.html (#22765)

Copy link

✨ Try run (#7540553241) succeeded.

@mrobinson mrobinson changed the title Replace time with std::time in components/script script: Start replacing time with std::time and chrono Jan 16, 2024
@mrobinson
Copy link
Member

I had to make some changes to get this working namely, fixing some precision issues in the animation timeline as well as not making the changes for navigation_start_precise. I think that in the former case, we will need to make these changes across the entire source code all at once.

@mrobinson mrobinson added this pull request to the merge queue Jan 16, 2024
Merged via the queue into servo:main with commit 9654363 Jan 16, 2024
41 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

3 participants