Closed Bug 1257153 Opened 4 years ago Closed 4 years ago

implicitlyWaitFor() leaks running timer instance in case of rejects

Categories

(Testing :: Marionette, defect)

defect
Not set

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: whimboo, Assigned: ato)

Details

(Keywords: memory-leak, pi-marionette-server)

Attachments

(1 file)

The implementation of `implicitlyWaitFor()` leaks a running timer instance if the promise gets rejected. Right now we only stop the timer in the resolved case:

https://dxr.mozilla.org/mozilla-central/source/testing/marionette/element.js#698
This fixes a leak where timers were not cancelled upon promise rejection.
When the function passed to implicitlyWaitFor is rejected for not finding
elements after the timeout has elapsed, the elementSearch callback is
no longer called because the timer is cancelled when it calls reject().

Review commit: https://reviewboard.mozilla.org/r/40447/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/40447/
Attachment #8731217 - Flags: review?(dburns)
Assignee: nobody → ato
Status: NEW → ASSIGNED
Attachment #8731217 - Flags: review?(dburns) → review+
Comment on attachment 8731217 [details]
MozReview Request: Bug 1257153 - Cancel implicit wait timers on rejection; r?automatedtester

https://reviewboard.mozilla.org/r/40447/#review36923
https://hg.mozilla.org/mozilla-central/rev/1fdf06c43011
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.