Closed
Bug 1219870
Opened 9 years ago
Closed 9 years ago
[mozlog] bad suite state if 'suite_start' and/or 'suite_end' received via log_raw
Categories
(Testing :: Mozbase, defect)
Testing
Mozbase
Tracking
(firefox45 fixed, b2g-v2.5 fixed)
RESOLVED
FIXED
mozilla45
People
(Reporter: ahal, Assigned: ahal)
References
Details
Attachments
(1 file)
Ran into this while working on bug 1034290. In StructuredLogger, we keep track of whether or not a suite_start/suite_end has been received and throw an error if they come in the wrong order: https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozlog/mozlog/structuredlog.py#232 But this check gets ignored if a log with a suite_start/suite_end action gets logged via the log_raw function. This can result in multiple suite_start/end messages being logged in the wrong order.
Assignee | ||
Comment 1•9 years ago
|
||
Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester
Attachment #8680791 -
Flags: review?(cmanchester)
Comment 2•9 years ago
|
||
Comment on attachment 8680791 [details] MozReview Request: Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester https://reviewboard.mozilla.org/r/23681/#review21229 It might be a little surprising that this invariant makes it to log_raw but the test_start/end one doesn't, what's the motivation for sending suite start/end through log_raw?
Attachment #8680791 -
Flags: review?(cmanchester)
Assignee | ||
Comment 3•9 years ago
|
||
The way it's currently set up is the python side just reads the line delimited json from reftest.js and forwards it wholesale to log_raw one line at a time. But imo, that's beside the point.. This is a bug whether or not we currently happen to use log_raw for that purpose.
Assignee | ||
Updated•9 years ago
|
Attachment #8680791 -
Flags: review?(cmanchester)
Comment 4•9 years ago
|
||
Comment on attachment 8680791 [details] MozReview Request: Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester https://reviewboard.mozilla.org/r/23681/#review21441 ::: testing/mozbase/mozlog/mozlog/structuredlog.py:229 (Diff revision 1) > + self.error("Got second suite_start message before suite_end.") You got rid of the part where we dump what was logged along with the error. ::: testing/mozbase/mozlog/mozlog/structuredlog.py:230 (Diff revision 1) > + return 1 We can use a boolean for this. ::: testing/mozbase/mozlog/mozlog/structuredlog.py:236 (Diff revision 1) > + self._state.suite_started = False > + Throw in a return value here. The value of a function call that doesn't execute a return statement happens to be falsy, but it might make this function a little unclear to rely on that because the function also has a side effect. I don't really think this is a bug, but I don't think the patch does any harm.
Attachment #8680791 -
Flags: review?(cmanchester) → review+
Assignee | ||
Comment 5•9 years ago
|
||
It's not a very important bug, no.. but it means mozlog won't error out if StructuredLog.jsm logs multiple suite_starts/ends. It certainly caused me a couple hours of my life trying to debug what was going on, as it caused a very non-obvious failure.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8680791 [details] MozReview Request: Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester Bug 1219870 - [mozlog] ensure correct suite state when logging suite_start/suite_end via StructuredLogger.log_raw, r=chmanchester
Comment 8•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9ad72faa8cdd
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Comment 9•9 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/9ad72faa8cdd
status-b2g-v2.5:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•