Open
Bug 1662503
Opened 5 years ago
Updated 8 months ago
Use only one helper to wait for a condition in devtools tests
Categories
(DevTools :: General, task, P3)
DevTools
General
Tracking
(Not tracked)
NEW
People
(Reporter: ochameau, Unassigned)
References
(Blocks 1 open bug)
Details
Today, DevTools codebase uses XXX helpers to wait for an async condition to become true:
- waitFor:
https://searchfox.org/mozilla-central/search?q=+waitFor%28&path=devtools%2F&case=false®exp=false - waitUntil:
https://searchfox.org/mozilla-central/search?q=+waitFor%28&path=devtools%2F&case=false®exp=false - asyncWaitUntil:
https://searchfox.org/mozilla-central/search?q=+waitUntil%28&path=devtools%2F&case=false®exp=false - BrowserTestUtils.waitForCondition:
https://searchfox.org/mozilla-central/search?q=BrowserTestUtils.waitForCondition%28&path=devtools%2F&case=false®exp=false
waitFor and waitUntil are used a lot, the others, much less.
waitUntil never throws, waitFor is probably more helpful for debugging failure, especially after your patch lands.
Also, waitFor supports async conditions, so i guess we could directly replace asyncWaitUntil with waitFor?
I see two options from here:
- migrate everything to waitFor. It would still be a devtools specific helper
- migrate everything to BrowserTestUtils.waitForCondition. Then devtools would just use same helper as the rest of mozilla-central
The issue with the second is that we would miss the small tweak of bug 1662066, which displays the stack trace and the condition function in case of failure.
| Reporter | ||
Comment 1•4 years ago
|
||
Note that waitUntil doesn't timeout, so when migrating from waitUntil to waitFor we might lever new times of intermittents.
Updated•8 months ago
|
Priority: -- → P3
You need to log in
before you can comment on or make changes to this bug.
Description
•