-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve handling of harness-level errors in wptrunner #10444
Conversation
@jugglinmike I think you might be interested in this. |
0022300
to
2d1b290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % docs, but I'd also like @jugglinmike to have a look.
Does any documentation of the different statuses exist? Having a description of "INTERNAL-ERROR" under docs/ (added in this PR) would make it easier to review, and benefits everyone trying to understand it in the future.
Also, do we need to run this through Gecko's CI to have confidence that this works? |
We don't currently have much documentation on the wptrunner internals, so there's nowhere obvious to add this. It isn't ever exposed to the user (it gets mapped down to ERROR before output because mozlog only supports a limited set of statuses, in order for consistency between users). |
https://treeherder.mozilla.org/#/jobs?repo=try&revision=890c9d39ed8c4239340954a1aed87fa3c02ba38e&selectedJob=173288584 is the try run started by our bot, although that doesn't include all tests by default. I can do another try run with everything if that looks OK. |
2d1b290
to
2bd39e3
Compare
@@ -563,10 +563,12 @@ def test_ended(self, test, results): | |||
# TODO: consider changing result if there is a crash dump file | |||
|
|||
# Write the result of the test harness | |||
result_subns = {"INTERNAL-ERROR": "ERROR", | |||
"EXTERNAL-TIMEOUT": "TIMEOUT"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "result" is being applied to the object that contains this status string. What do you think of status_subns
or status_map
?
@foolip's request for documentation seems reasonable to me, but I also understand @jgraham's reluctance to bloat usage instructions with implementation details. A few ideas: James writes, "It isn't ever exposed to the user (it gets mapped down to ERROR before output because mozlog only supports a limited set of statuses, in order for consistency between users)." If this detail was included as an in-line comment, we could address Philip's concern about "everyone trying to understand it in the future" without adding to the information we present to the average user This patch overloads the string "ERROR" a bit. Depending on the context, it could mean "test error, not harness error", but it could also mean "test error or harness error". This could be confusing for others. Since the latter definition is unrestricted, it more closely matches the string. Would it be too onerous to introduce a new value dedicated to the "test error, not harness error" status? (This would also help future contributors get their bearings since the distinction James is making would be explicitly reflected in the code.) Thanks for taking the lead on this, James! |
Adding a new error status to mozlog is hard, because it involves updating it, making a release, updating all formatters to ensure that they don't choke on the new value, and hoping you didn't miss any external ones. It's about now you realise why it is that people like languages with enums and irrefutable pattern matching… mozlog would be great in Rust ;) I'm happy to add a comment about what's going on in the source though. |
Split the internal handling of errors during a test into two cases; INTERNAL-ERROR that is produced if there's an exception in the harness and ERROR that is for exceptions reported by the test. Both are still reported as ERROR to the user, but in the INTERNAL-ERROR case the runner is always restarted, just like EXTERNAL-TIMEOUT, since we assume that the internal state is compromised somehow.
2bd39e3
to
712be3d
Compare
I expected the path to updating mozlog would be a difficult one, but I also
Still looking for an excuse to learn that language... |
Oh, I see. The |
This looks good to me. I don't know how to interpret the Treeherder UI, though. Does it make sense to move forward with that complete test run, now? |
tools/wptrunner/docs? |
Split the internal handling of errors during a test into two cases;
INTERNAL-ERROR that is produced if there's an exception in the harness
and ERROR that is for exceptions reported by the test. Both are still
reported as ERROR to the user, but in the INTERNAL-ERROR case the
runner is always restarted, just like EXTERNAL-TIMEOUT, since we
assume that the internal state is compromised somehow.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)