Closed Bug 1382603 Opened 4 years ago Closed 3 years ago

Fix 7 tests failures on devtools/client/performance due the EventEmitter refactoring

Categories

(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P2)

enhancement

Tracking

(firefox61 fixed)

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: zer0, Assigned: nchevobbe)

References

Details

Attachments

(2 files)

Failing tests:

devtools/client/performance/test/browser_perf-button-states.js
devtools/client/performance/test/browser_perf-calltree-js-categories.js
devtools/client/performance/test/browser_perf-calltree-js-columns.js
devtools/client/performance/test/browser_perf-calltree-js-events.js
devtools/client/performance/test/browser_perf-calltree-memory-columns.js
devtools/client/performance/test/browser_perf-console-record-01.js
devtools/client/performance/test/browser_perf-console-record-02.js

The refactoring is currently only on:

https://github.com/zer0/gecko/tree/event-emitter-1381542

We need to address the test failures before land this patch in m-c.
Here the original try build with the failures:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=bba13e27a2371fa8aad68b9b227534b31829cb0d

Those failures are most likely due the breaking change in how the `EventEmitter` emits event.

Previously, the first argument was the type event:

  myEmitter.on("custom-event", (eventType, message) => { ... });

Now the first argument is the message:

  myEmitter.on("custom-event", (message) => { ... });

In the majority of the scenario the `eventType` is ignored by our code, so we should just remove it from the function's signature.

For more details, see: https://github.com/devtools-html/snippets-for-removing-the-sdk/#events
Flags: qe-verify-
Priority: -- → P2
No longer blocks: 1381542
Blocks: 1384546
Whiteboard: [nosdk]
Component: Developer Tools → Developer Tools: Performance Tools (Profiler/Timeline)
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Comment on attachment 8961378 [details]
Bug 1382603 - Adapt performance panel tests to the new EventEmitter; .

https://reviewboard.mozilla.org/r/230154/#review235800


Code analysis found 3 defects in this patch:
 - 3 defects found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: devtools/client/performance/test/browser_perf-console-record-06.js:39
(Diff revision 1)
>    is(getSelectedRecording(panel), recordings[0],
>      "The first console recording should be selected.");
>  
>    // Ensure overview is still rendering.
>    await times(OverviewView, EVENTS.UI_OVERVIEW_RENDERED, 3, {
> -    expectedArgs: { "1": Constants.FRAMERATE_GRAPH_LOW_RES_INTERVAL }
> +    expectedArgs:[Constants.FRAMERATE_GRAPH_LOW_RES_INTERVAL]

Error: Missing space before value for key 'expectedargs'. [eslint: key-spacing]

::: devtools/client/performance/test/browser_perf-loading-02.js:36
(Diff revision 1)
>  
>    is(detailsContainer.selectedPanel, recordingNotice,
>      "The recording-notice is shown while recording.");
>  
>    let recordingStopping = once(PerformanceController, EVENTS.RECORDING_STATE_CHANGE, {
> -    expectedArgs: { "1": "recording-stopping" }
> +    expectedArgs:["recording-stopping"]

Error: Missing space before value for key 'expectedargs'. [eslint: key-spacing]

::: devtools/client/performance/test/browser_perf-loading-02.js:39
(Diff revision 1)
>  
>    let recordingStopping = once(PerformanceController, EVENTS.RECORDING_STATE_CHANGE, {
> -    expectedArgs: { "1": "recording-stopping" }
> +    expectedArgs:["recording-stopping"]
>    });
>    let recordingStopped = once(PerformanceController, EVENTS.RECORDING_STATE_CHANGE, {
> -    expectedArgs: { "1": "recording-stopped" }
> +    expectedArgs:["recording-stopped"]

Error: Missing space before value for key 'expectedargs'. [eslint: key-spacing]
Comment on attachment 8961377 [details]
Bug 1382603 - Remove old-event-emitter usage from performance panel; .

https://reviewboard.mozilla.org/r/230152/#review236644

All the changes look pretty reasonable here. Thanks for the cleanup!
Attachment #8961377 - Flags: review?(gtatum) → review+
Comment on attachment 8961378 [details]
Bug 1382603 - Adapt performance panel tests to the new EventEmitter; .

https://reviewboard.mozilla.org/r/230154/#review236650

LGTM! Thanks for all the cleanup.
Attachment #8961378 - Flags: review?(gtatum) → review+
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e7a33821496d
Remove old-event-emitter usage from performance panel; r=gregtatum.
https://hg.mozilla.org/integration/autoland/rev/f060b453b368
Adapt performance panel tests to the new EventEmitter; r=gregtatum.
https://hg.mozilla.org/mozilla-central/rev/e7a33821496d
https://hg.mozilla.org/mozilla-central/rev/f060b453b368
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.