Closed Bug 1447411 Opened 7 years ago Closed 6 years ago

Web Replay: Get mochitests working

Categories

(Core :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox61 --- affected

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(7 files)

There are several mochitests for Web Replay in place already, which are nice for testing locally but have a number of problems causing unexpected failures. This bug is about fixing these issues and getting a clean bill of health for the tests from the mochitest harness.
The middleman process wasn't shutting down or flushing session store state in response to IPDL messages to close it, leading the mochitest harness to kill it. This is because the messages were being forwarded to the replaying process, which ignored them. This patch handles these messages in the middleman.
There are some uncaught rejections on the web replay tests due to the client trying to interact with frame actors that no longer exist. I haven't tracked down the underlying cause here but fixing it will probably require changing the client, which I don't want to do right now. Anyways, suppressing these rejections is tricky because neither of the two APIs that PromiseTestUtils provides are very suitable. expectUncaughtRejection does not work because the rejections don't always happen, and whitelistRejectionsGlobally affects the behavior of later tests. This patch adds a third API, removeUncaughtRejections, that filters out uncaught rejections from the current test which match a pattern.
Catch an exception that was being thrown when the debugger server tried to use a frame that wasn't live. There might be an underlying issue here related to the invalid frame actors thing mentioned in comment 2.
Avoid all uncaught rejections on web replay tests, by fixing a bug where listeners for one test were being called on future tests, and by suppressing the remaining rejections with the API added in part 2.
The function added in part 2 hasn't been working very reliably, so this patch removes it and globally whitelists the rejections on the web replay tests. https://hg.mozilla.org/projects/ash/rev/b7540bed619c4b8630e1993c61cdf2e488a9984f
This patch fixes an issue stemming from Part 1. When the middleman receives browser close messages it both handles them itself and forwards them to the child process. If the child process is still recording then it will send responses to those close messages, and since the middleman sent them as well the UI process receives two sets of messages and gets confused. The close messages from the middleman are the canonical ones, so we just drop any messages coming from the child process for a browser that the UI process has destroyed. https://hg.mozilla.org/projects/ash/rev/2edfde574e9fe9c07de73ddd9b8525543ca5eb9c With these patches the web replay tests are running and (usually) green on treeherder.
Fix a crash that happened while recording due to the main thread treating all threads as idle even though there were in flight off thread call events (these call events are a kind of tricky mechanism that allow the main thread to record snapshots even if other threads are doing blocking system calls like kevent). https://hg.mozilla.org/projects/ash/rev/99de8008418f370c5be411c9bc113885f00facc2 With this change the web replay mochitests are green about 90% of the time.
Closing this bug, all the changes here will be reviewed in separate bugs dependent on bug 1422587.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: