Open Bug 1987552 Opened 11 months ago Updated 6 months ago

Pageloader ContentListener event listeners are never being removed

Categories

(Testing :: Talos, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: sparky, Unassigned)

References

Details

(Whiteboard: [fxp][operational])

In talos, we have the following listeners added to monitor pageload progress: https://searchfox.org/firefox-main/rev/010c6878a1520b36721b63846d1b0c44b23524d0/testing/talos/talos/pageloader/chrome/pageloader.js#323-342

The issue is that these get constantly re-added because this event listener gets constantly re-added without the removal of the one that was previously added: https://searchfox.org/firefox-main/rev/010c6878a1520b36721b63846d1b0c44b23524d0/testing/talos/talos/pageloader/chrome/pageloader.js#302-306

This needs to be called on each page change since the "remoteness" changes (something with how Firefox works I think). However, the problem is that the previously added listeners are never removed leading to many many event listeners being registered to listen for TabRemotenessChange by the end of a pageloader-based talos test.

This doesn't seem to cause any issues in our tests at the moment, but it was a bit of a rabbit hole or red-herring we spent time on in bug 1893092.

I did manage to make a patch to resolve this issue here, but the consequences of the changes we needed to make to resolve this issue are unclear and the patch needs more testing: https://treeherder.mozilla.org/jobs?repo=try&revision=04915b46b3df154ee3dacc3147ce74839da13795

For one, I ended up converting some methods to be async to fix the issue (so we don't add the message listeners too early) and I'm not sure if that may cause some issues. The patch was also only tested on Windows, with some light testing on Linux.

Whiteboard: [fxp] → [fxp][operational]
You need to log in before you can comment on or make changes to this bug.