Converge all waiting helper of the netmonitor tests into one or two
Categories
(DevTools :: Netmonitor, enhancement)
Tracking
(firefox76 fixed)
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(5 files)
We have way too many different wait mechanisms in the netmonitor tests:
- waitForAllNetworkUpdateEvents
- waitForNetworkEvents
- waitForAllRequestsFinished
- waitForRequestsFinished
- and probably some others...
Bug 1439509 highlights that the existing helpers are not enough and a combination of either waitForNetworkEvents + waitForAllNetworkUpdateEvents or initNetmonitor + waitForAllNetworkUpdateEvents are necessary in order to prevent having pending requests.
In his WIP patch, Sorin started adding calls to waitForAllNetworkUpdateEvents
here and there, but that doesn't scale:
- it piles up wait methods. Everywhere a call to
waitForAllNetworkUpdateEvents
was added, there was already a wait method in the test. EitherinitNetMonitor
(which calls some wait methods internally) orwaitForNetworkEvents
. - it most likely require to go modify all netmonitor tests!
We should probably first do a swap on all these various wait methods, so that we can more easily integrate waitForAllNetworkUpdateEvents
into all the existing methods.
I started looking and the lack of consistancy in the helper methods being used highlights that we are not waiting for many async calls. This is probably the source of various intermittents.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Other tests are typically using waitForNetworkEvents when doing a reload,
with a clear assertion on how many requests should be displayed and awaited for.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
We were explicitely waiting for event timings in two tests only,
but these requests are also done in most other tests using waitForNetworkEvents.
Unfortunately, EVENT_TIMINGS aren't always fetched, so it complexify
waitForNetworkEvents a bit. But I think it would prevent pending requests
and helps using a unique wait helper.
Assignee | ||
Comment 5•5 years ago
|
||
This test was wrong. The event timings were fire before, when performing the request.
Not when opening the context menu. So, with the previous changeset, this test started to fail.
Assignee | ||
Comment 6•5 years ago
|
||
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a8244239b26b
https://hg.mozilla.org/mozilla-central/rev/8e3c88718a88
https://hg.mozilla.org/mozilla-central/rev/1d8ef16a713b
https://hg.mozilla.org/mozilla-central/rev/cb0ca583ad73
https://hg.mozilla.org/mozilla-central/rev/527cb874447a
Description
•