Closed Bug 1155896 Opened 9 years ago Closed 9 years ago

xpcshell log statements truncated due to equality checks for long strings

Categories

(Toolkit :: Application Update, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: robert.strong.bugs, Assigned: robert.strong.bugs)

Details

Attachments

(1 file, 3 obsolete files)

I saw this while working on another bug and from what I can tell it happens when there are full paths in the update log files.
Attached patch patch rev1 (obsolete) — Splinter Review
Stephen, while working on a different bug I noticed that when comparing strings using Assert.equal that the string printed in the xpcshell log was truncated if the string was long due to there being a path. To fix this I've replaced the common part of the path for the tests. I also noticed that the call to checkCallbackAppLog wasn't completing on the marAppApplyUpdate* tests and that these tests shouldn't call that function since they never create a callback log since they use the app which won't create that log file. The reason it never caused a problem is due to checkCallbackAppLog using a timer to call itself over and over until the callback log is created and the callsites continuing the tests so they passed anyways.
Assignee: nobody → robert.strong.bugs
Status: NEW → ASSIGNED
Attachment #8594283 - Flags: review?(spohl.mozilla.bugs)
Attached patch patch rev2 (obsolete) — Splinter Review
Just noticed that debugDump was not printing out the correct caller so I added that to this patch as well.
Attachment #8594283 - Attachment is obsolete: true
Attachment #8594283 - Flags: review?(spohl.mozilla.bugs)
Attachment #8594289 - Flags: review?(spohl.mozilla.bugs)
Attached patch patch rev3 (obsolete) — Splinter Review
and another just noticed...

when DEBUG_AUS_TEST is true the xpcshell harness head.js outputs the following errors repeatedly
"JavaScript error: c:\\moz\\_1_mozilla-central\\mozilla\\testing\\xpcshell\\head.js, line 130: TypeError: do_print is not a function"
[10504] WARNING: Reentrancy error: some client attempted to display a message to the console while in a console listener. The following message was discarded: "[JavaScript Error: "TypeError: do_print is not a function" {file: "c:\\moz\\_1_mozilla-central\\mozilla\\testing\\xpcshell\\head.js" line: 130}]": file c:\\moz\\_1_mozilla-central\\mozilla\\xpcom\\base\\nsConsoleService.cpp, line 191

Turning off logging in nsUpdateService.js before do_test_finished and calling do_test_finished with do_execute_soon these errors are no longer printed. This is due to the logging in nsUpdateService.js using Services.console.logStringMessage and do_print no longer being defined for the the observer in xpcshell's head.js and the do_execute_soon is needed to allow nsUpdateService.js time to disable logging.
Attachment #8594289 - Attachment is obsolete: true
Attachment #8594289 - Flags: review?(spohl.mozilla.bugs)
Attachment #8594309 - Flags: review?(spohl.mozilla.bugs)
Attached patch patch rev4Splinter Review
better still... this fixes all of the do_print errors that are logged
Attachment #8594309 - Attachment is obsolete: true
Attachment #8594309 - Flags: review?(spohl.mozilla.bugs)
Attachment #8594314 - Flags: review?(spohl.mozilla.bugs)
There are problems with the patch from bug 1156046. Push to try with just this patch
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b836124d94f1
Attachment #8594314 - Flags: review?(spohl.mozilla.bugs) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: