SpecialPowers.pushPermissions is async but returns too early (before permission is applied)
Categories
(Testing :: Mochitest, defect)
Tracking
(firefox71 fixed, firefox72 fixed)
People
(Reporter: robwu, Assigned: robwu)
References
Details
Attachments
(2 files)
47 bytes,
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
Details | Review |
I added a new test in bug 1589754 that used SpecialPowers.pushPermissions
. The patch got backed out, and I guess that it may be due to the fact that this test helper returns too early.
The helper is async and takes a callback, but the async function returns before when the callback would be called. This may result in intermittent test failures.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
SpecialPowers.pushPermissions
was made async in bug 1541557 . I'll attach a patch that adds a proper wait, and then convert callback consumers of SpecialPowers.pushPermissions
to the promise-based API to promote the usage of the promise-based API in the code base.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Some callers of SpecialPowers.pushPermissions wrapped the call in a
promise. That is not needed; directly use the returned promise instead.
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1d5f3e751433
https://hg.mozilla.org/mozilla-central/rev/cc7ea5119035
Assignee | ||
Comment 7•5 years ago
|
||
Comment on attachment 9103973 [details]
Bug 1591102 - Let SpecialPowers.pushPermissions wait until the permissions have been applied
Beta/Release Uplift Approval Request
- User impact if declined: Bug 1589754 was fixed and contained a unit test. The unit test depends on a correct functioning of this test helper. Without this test helper, the patch for the other bug cannot be uplifted to beta.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Minimal change that fixes logic of a test-only helper, has baked in m-c and was confirmed to fix the test failure of bug 1589754.
- String changes made/needed: none
Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
Comment on attachment 9103973 [details]
Bug 1591102 - Let SpecialPowers.pushPermissions wait until the permissions have been applied
Uplift approved for 71 beta 7, thanks.
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
Comment on attachment 9103974 [details]
Bug 1591102 - Let some SpecialPowers.pushPermissions callers use promises
I meant to only ask for uplift on the first patch, not the second one. Could you clear uplift approval on this second patch?
Updated•5 years ago
|
Comment 10•5 years ago
|
||
bugherder uplift |
Description
•