Closed Bug 1758909 Opened 4 years ago Closed 4 years ago

Improvements for js/xpconnect/tests/marionette/test_preloader_telemetry.py

Categories

(Core :: XPConnect, enhancement, P2)

enhancement
Points:
1

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

Details

(Whiteboard: [bidi-m3-mvp])

Attachments

(1 external file)

The test is currently broken when certain code is awaiting an observer notification. Hereby the Execute Script and not the Execute Async Script command of Marionette is called:

https://searchfox.org/mozilla-central/rev/d6850ecec549f9a1b10dd8ec8823db3791cf81fd/js/xpconnect/tests/marionette/test_preloader_telemetry.py#65-73

This means that the command actually returns immediately and not when the notification has actually been retrieved.

Further the existing asserts for hits and misses are not that helpful given that we compare booleans and not the numbers directly. As such I would suggest to use assertions like assertGreater and assertLess.

This patch allows to correctly await observer notifications by
using the "Execute Async Command" of Marionette which doesn't
return immediately but when resolve() is called.

Further it improves the checks for hits and misses by comparing
numbers and not just booleans. This improves the failure output.

Attachment #9267180 - Attachment description: WIP: Bug 1758909 - Improvements for test_preloader_telemetry.py. r?dthayer → Bug 1758909 - Improvements for test_preloader_telemetry.py
Points: --- → 1
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/89fa75e3ec66 Improvements for test_preloader_telemetry.py r=dthayer
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: