Closed Bug 1876221 Opened 1 year ago Closed 1 year ago

Assert.sys.mjs tries to JSON.stringify XPCOM objects, fails, and this takes a long time

Categories

(Testing :: General, defect)

defect

Tracking

(firefox124 fixed)

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(1 file)

I've been investigating bug 1860239, which is about a mochitest taking an extraordinary amount of time when run on the Windows CI. (Up to 15 minutes, when on my machine I can run it in 20 seconds.)

I've found the cause is (at least partly) the logging of some Assert calls with complex XPCOM objects. In trying to work out what to log, the code calls JSON.stringify on the objects and when that fails reverts to calling toString. I don't know why, but stringify is taking a very long time to work out that it cannot succeed.

I propose to just avoid calling stringify for any object that has a QueryInterface function. This speeds up the test in question a lot.

Pushed by geoff@darktrojan.net: https://hg.mozilla.org/integration/autoland/rev/78e9fd141aaf Avoid calling JSON.stringify on XPCOM objects in Assert.sys.mjs. r=jmaher
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
Blocks: 1879018
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: