testNodePrincipal is the only subtest whose alert uses a content principal. For
content-principal notifications, nsIAlertNotification.name returns the
notification's internal id (an origin-namespaced hash) rather than the
app-provided name, and nsXULAlerts registers the alert window under that id. So
closeAlert("nodePrincipal") matches nothing and is a silent no-op, leaving the
alert to be dismissed only by its auto-close animation. When that animation does
not complete the alert never closes and the test times out.
Close by alert.name -- the id the window is actually registered under -- so the
alert is dismissed deterministically instead of relying on the animation.
Differential Revision: https://phabricator.services.mozilla.com/D310065