Closed Bug 909142 Opened 11 years ago Closed 11 years ago

testing/xpcshell/head.js fails to match JS error stack frames

Categories

(Testing :: XPCShell Harness, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: jimb, Assigned: jimb)

Details

Attachments

(1 file)

(I don't know if this is even a good idea to fix, but I fixed it...)

The regular expression in testing/xpcshell/head.js's _format_exception_stack function no longer matches stack frames stored on the 'stack' property of Error instances. Thus, errors appear this way in xpcshell test output:

 0:00.16 JS frame :: testAddrInUse@/home/jimb/moz/dbg/obj-bug/_tests/xpcshell/netwerk/test/unit/test_addr_in_use_error.js:15

instead of this, as _format_exception_stack apparently intends:

 0:00.16 JS frame :: /home/jimb/moz/dbg/obj-bug/_tests/xpcshell/netwerk/test/unit/test_addr_in_use_error.js :: testAddrInUse :: line 15

I don't know why one format is better than the other, but seeing the regexp which will never match in the code instills in one a certain sense of futility, reminiscent of the bitterness that lingers from the realization, so often reached at some bleak moment shortly after one had gained majority, that there is no responsive omnipotent will --- neither God, nor some emergent invisible hand, nor evolutionary forces onto which we might project our own aspirations and thus bring within reach of our comprehension, so we might bargain or ingratiate ourselves --- no will that watches for decay and corruption, and acts to repair it.

Of course, we could drop the frame-matching code altogether, and simply print the frames as the engine has formatted them. It being meaningless to attempt to distance oneself from a void that surrounds one in all directions, it may be better to extinguish a spark immediately, than to attempt to sustain it.
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Attachment #795185 - Flags: review?(ted)
Comment on attachment 795185 [details] [diff] [review]
Fix xpcshell test harness regexp matching JS stack frames. But to what end?

Review of attachment 795185 [details] [diff] [review]:
-----------------------------------------------------------------

I honestly don't know why things are formatted that way. It probably doesn't matter how we print it, I'm 99% sure nothing actually relies on that stack format (or we presumably would have noticed it being broken in the interim).

A+++ would read comment 0 again.
Attachment #795185 - Flags: review?(ted) → review+
Paranoid resource-wasting try push:
https://tbpl.mozilla.org/?tree=Try&rev=efcb231e95c7
https://hg.mozilla.org/integration/mozilla-inbound/rev/f66ac3e480ca
Flags: in-testsuite-
Target Milestone: --- → mozilla26
https://hg.mozilla.org/mozilla-central/rev/f66ac3e480ca
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: