Bug 195134 - [GTK] New CPU profiler tests failing
Summary: [GTK] New CPU profiler tests failing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Diego Pino
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-27 17:20 PST by Alicia Boya García
Modified: 2020-10-08 00:54 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.05 KB, patch)
2020-10-06 05:43 PDT, Diego Pino
no flags Details | Formatted Diff | Diff
Patch (2.06 KB, patch)
2020-10-07 01:32 PDT, Diego Pino
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alicia Boya García 2019-02-27 17:20:50 PST
inspector/cpu-profiler/threads.html
inspector/cpu-profiler/tracking.html

Introduced in r241739.

--- /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/inspector/cpu-profiler/threads-expected.txt
+++ /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/inspector/cpu-profiler/threads-actual.txt
@@ -10,13 +10,10 @@
 PASS: Event should have a timestamp.
 PASS: Event should have a usage.
 PASS: usage should be greater than or equal to zero.
-PASS: Event should have threads.
-PASS: Every thread has between 0 and 100 usage.
-PASS: Event should have 1 main thread.
-PASS: Event should have 2 worker threads.
-PASS: Event should have other worker threads.
-PASS: Worker 1 usage should be greater than zero.
-PASS: Worker 2 usage should be greater than zero.
-PASS: Total usage should be greater than or equal to the sum of both worker threads.
-CPUProfiler.trackingComplete
+FAIL: Event should have threads.
+    Expected: truthy
+    Actual: false
+!! EXCEPTION: undefined is not an object (evaluating 'messageObject.params.event.threads')
+Stack Trace: #0: (anonymous) (unknown)
+#1: promiseReactionJob [native code]
Comment 1 Miguel Gomez 2019-05-02 06:38:49 PDT
inspector/cpu-profiler/tracking.html is passing since r244478.
Comment 2 Diego Pino 2020-10-06 05:43:41 PDT
Created attachment 410627 [details]
Patch
Comment 3 Diego Pino 2020-10-06 05:45:43 PDT
inspector/cpu-profiler/threads.html is a flaky failure. It has been passing since r266388, but it fails occasionally. For instance:

Diff: https://build.webkit.org/results/GTK%20Linux%2064-bit%20Release%20(Tests)/r267958%20(16233)/inspector/cpu-profiler/threads-diff.txt

--- /home/buildbot/worker/gtk-linux-64-release-tests/build/layout-test-results/inspector/cpu-profiler/threads-expected.txt
+++ /home/buildbot/worker/gtk-linux-64-release-tests/build/layout-test-results/inspector/cpu-profiler/threads-actual.txt
@@ -17,6 +17,8 @@
 PASS: Event should have other worker threads.
 PASS: Worker 1 usage should be greater than zero.
 PASS: Worker 2 usage should be greater than zero.
-PASS: Total usage should be greater than or equal to the sum of both worker threads.
+FAIL: Total usage should be greater than or equal to the sum of both worker threads.
+    Expected: greater than or equal to 198.53888702392578
+    Actual: 198.53887939453125
 CPUProfiler.trackingComplete

The difference is minimal. I pushed a patch to round the decimal part to 4 digits only.
Comment 4 Joseph Pecoraro 2020-10-06 10:03:54 PDT
Comment on attachment 410627 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=410627&action=review

> LayoutTests/inspector/cpu-profiler/threads.html:52
> +                let totalUsage = Float(messageObject.params.event.usage.toFixed(4));

Err, no such thing as `Float()` in JavaScript?

> ! EXCEPTION: Can't find variable: Float
>  21Stack Trace: #0: (anonymous) (unknown)
>  22#1: promiseReactionJob [native code]

Would this work?

    let totalUsage = messageObject.params.event.usage.toFixed(4);
    let workersUsage = (workers[0].usage + workers[1].usage).toFixed(4);
Comment 5 Diego Pino 2020-10-07 01:32:52 PDT
Created attachment 410736 [details]
Patch
Comment 6 EWS 2020-10-08 00:54:42 PDT
Committed r268174: <https://trac.webkit.org/changeset/268174>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410736 [details].