Closed Bug 1473614 Opened 6 years ago Closed 6 years ago

Add debugging shorthand for pausing the thread

Categories

(Remote Protocol :: Marionette, enhancement, P1)

enhancement

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ato, Assigned: ato)

References

Details

Attachments

(4 files)

Using TimedPromise it is possible to create a promise that returns
given a duration.  However, it is a somewhat large amount of
boilerplate to do so requiring you to look up the API.

Given that WebDriver provides a largely time- and synchronisation-critical
protocol it would be useful with a shorthand to pause the thread
using async/await for an arbitrary amount of time.

This shorthand must—of course—never be used in production.
Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: -- → P1
This patch introduces stricted type checks for the sync module's
PollPromise and TimedPromise.  This may seem excessive, but we have
had real and severe bugs in this area before.
Attachment #8997459 - Flags: review?(dburns)
This adds a new public API to the Marionette sync module that can
"pause" async functions for an arbitrary amount of hardcoded time.
This can be useful for debugging purposes.
Attachment #8997460 - Flags: review?(dburns)
The "exported" keyword is no longer needed.
Attachment #8997461 - Flags: review?(dburns)
Attachment #8997459 - Flags: review?(dburns) → review+
Attachment #8997460 - Flags: review?(dburns) → review+
Attachment #8997461 - Flags: review?(dburns) → review+
Attachment #8997462 - Flags: review?(dburns) → review+
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/87a0ebcd004f
Add type checks to PollPromise and TimedPromise. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ee58097b141
Add sync function Sleep for pausing async functions. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/1d28e128807c
Fix exported symbols in sync. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/027922b5ef04
Expose API docs for MessageManagerDestroyedPromise and Sleep. r=automatedtester
I believe I have fixed the fallout on slower systems.  Doing a try
run to confirm:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5cf67fb67e8c960c36a3d8902388069843387098
Flags: needinfo?(ato)
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/075c87b1393a
Add type checks to PollPromise and TimedPromise. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/c76d0cb71ad4
Add sync function Sleep for pausing async functions. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/684c928574c6
Fix exported symbols in sync. r=automatedtester
https://hg.mozilla.org/integration/mozilla-inbound/rev/ff6be2623035
Expose API docs for MessageManagerDestroyedPromise and Sleep. r=automatedtester
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: