Closed
Bug 1114432
Opened 11 years ago
Closed 11 years ago
mozdevice forward raise exception cause MCTS failed
Categories
(Firefox OS Graveyard :: Certification Suite, defect)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: oouyang, Assigned: oouyang)
References
Details
Attachments
(1 file, 2 obsolete files)
1.45 KB,
patch
|
atsai
:
review-
jgriffin
:
review-
|
Details | Diff | Splinter Review |
Bug 1094164 - [mozdevice] Port forward will fail if the socket is already bound. (edit)
Before the bug 1094164 landing, forward return 0 or 1 to indicate failure or success of forward action.
After landing, it cause MCTS failed.
Assignee | ||
Updated•11 years ago
|
Blocks: b2g-cert-tests
Assignee | ||
Comment 1•11 years ago
|
||
Please help to review the code
Attachment #8543946 -
Flags: review?(jgriffin)
Attachment #8543946 -
Flags: review?(atsai)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8543946 -
Attachment is obsolete: true
Attachment #8543946 -
Flags: review?(jgriffin)
Attachment #8543946 -
Flags: review?(atsai)
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8543955 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Attachment #8543963 -
Flags: review?(jgriffin)
Attachment #8543963 -
Flags: review?(atsai)
Comment 4•11 years ago
|
||
Comment on attachment 8543963 [details] [diff] [review]
bug1114432.patch
Review of attachment 8543963 [details] [diff] [review]:
-----------------------------------------------------------------
This will still cause us to thrown an exception when dm.forward fails, and I'm not sure that returning the error code is useful. Instead, I suggest we wrap call sites with try/except so we can handle the exception.
Attachment #8543963 -
Flags: review?(jgriffin) → review-
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 8543963 [details] [diff] [review]
bug1114432.patch
We need this function return 0 when forward successfully for MCTS.
In this fix, if it forwarded failed, it throws a DMError, but in old code it return not 0, and MCTS throws another exception. The situation is almost the same what we expected.
If it forwarded successfully, it return 0 and continue MCTS. And in old code it return None and cause exception because None is not 0 and MCTS cannot continue.
After the fix, we expected the MCTS could continue when it forwards successfully.
I think this meet MCTS needs and not break the original fix to throw DMError when forwarding failed.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → oouyang
Comment 6•11 years ago
|
||
At issue are blocks of code in MCTS like this:
https://github.com/mozilla-b2g/fxos-certsuite/blob/v2.0/certsuite/cert.py#L384
if dm.forward("tcp:2828", "tcp:2828") != 0:
raise Exception("Can't use localhost:2828 for port forwarding." \
"Is something else using port 2828?")
We could instead change this to:
try:
dm.forward("tcp:2828", "tcp:2828")
except DMError:
raise Exception("Can't use localhost:2828 for port forwarding." \
"Is something else using port 2828?")
I think this is better than changing DeviceManagerADB to return 0 in the passing case, from a design perspective.
Assignee | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
![]() |
||
Updated•11 years ago
|
Attachment #8543963 -
Flags: review?(atsai) → review-
You need to log in
before you can comment on or make changes to this bug.
Description
•