Bug 218253

Summary: REGRESSION (r268897): [macOS WK1] inspector/cpu-profiler/threads.html is a flaky failure
Product: WebKit Reporter: Ryan Haddad <ryanhaddad>
Component: Web InspectorAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, cdumez, darin, ggaren, hi, inspector-bugzilla-changes, joepeck, nvasilyev, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=218051
https://bugs.webkit.org/show_bug.cgi?id=217724
Attachments:
Description Flags
Patch none

Description Ryan Haddad 2020-10-27 11:59:36 PDT
inspector/cpu-profiler/threads.html has become a flaky failure on macOS WK1 bots

--- /Volumes/Data/slave/mojave-release-tests-wk1/build/layout-test-results/inspector/cpu-profiler/threads-expected.txt
+++ /Volumes/Data/slave/mojave-release-tests-wk1/build/layout-test-results/inspector/cpu-profiler/threads-actual.txt
@@ -13,10 +13,16 @@
 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.
+FAIL: Event should have 2 worker threads.
+    Expected: 2
+    Actual: 7
 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.
+FAIL: Worker 1 usage should be greater than zero.
+    Expected: greater than 0
+    Actual: 0
+FAIL: Worker 2 usage should be greater than zero.
+    Expected: greater than 0
+    Actual: 0
 PASS: Total usage should be greater than or equal to the sum of both worker threads.
 CPUProfiler.trackingComplete
 

https://results.webkit.org/?suite=layout-tests&test=inspector%2Fcpu-profiler%2Fthreads.html
Comment 1 Ryan Haddad 2020-10-27 12:00:10 PDT
It looks like this started after https://trac.webkit.org/changeset/268897/webkit landed
Comment 2 Radar WebKit Bug Importer 2020-10-27 12:00:36 PDT
<rdar://problem/70732755>
Comment 3 Ryan Haddad 2020-10-28 16:11:02 PDT
I have not yet been able to reproduce this locally by running this test alone in iterations.
Comment 4 Chris Dumez 2020-11-02 10:01:46 PST
Created attachment 412936 [details]
Patch
Comment 5 Geoffrey Garen 2020-11-02 10:19:48 PST
Comment on attachment 412936 [details]
Patch

r=me

I kinda wish there were a thread.type for worker (and perhaps a distinct thread.type for ServiceWorker).
Comment 6 EWS 2020-11-02 11:13:16 PST
Committed r269257: <https://trac.webkit.org/changeset/269257>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412936 [details].
Comment 7 Joseph Pecoraro 2020-11-03 10:09:46 PST
Comment on attachment 412936 [details]
Patch

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

> LayoutTests/ChangeLog:10
> +        Check the thread name to identify the 2 worker threads. This is needed so that worklet thread are
> +        not identified as worker threads after r268897.

Should we be identifying Worklet threads and have inspector tests for that?
Comment 8 Chris Dumez 2020-11-03 10:11:49 PST
(In reply to Joseph Pecoraro from comment #7)
> Comment on attachment 412936 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=412936&action=review
> 
> > LayoutTests/ChangeLog:10
> > +        Check the thread name to identify the 2 worker threads. This is needed so that worklet thread are
> > +        not identified as worker threads after r268897.
> 
> Should we be identifying Worklet threads and have inspector tests for that?

Probably? Web Inspector support for AudioWorklet is still mostly missing:
https://bugs.webkit.org/show_bug.cgi?id=217724