Closed Bug 789496 Opened 12 years ago Closed 12 years ago

DeviceManagerSUT should not require prompt to be sent at the same time as agent warnings

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla18

People

(Reporter: mcote, Unassigned)

Details

Attachments

(2 files)

DeviceManagerSUT has an implicit assumption that the command prompt will be sent along with an error message. That is, if the agent sends the error message and the next command prompt in separate packets, the prompt will not be consumed along with the message, and so it will be treated as the response to the next command, and future commands and responses will become unsynchronized. We haven't noticed this yet because the Java SUTAgent always appends the prompt to the response to the previous command, and so the DeviceManager reads it all together and ignores the prompt. In the C++ agent, we were sending the prompt as a separate message, and it caused all kinds of failures. DeviceManager should be agnostic as to how many packets it takes to get to the next command prompt, assuming it arrives in a timely fashion.
This ensures that, after reading a warning message, we consume the rest of the available data, including the prompt. I have a unit test which I'll post as a separate patch.
Attachment #659365 - Flags: review?(wlachance)
Attached patch Unit test (deleted) — Splinter Review
Unit test for mozbase to verify my fix. Also fixed up the fake-agent thread and added the final missing step to the initialization procedure, the lack of which would cause test_init to fail intermittently.
Attachment #659367 - Flags: review?(wlachance)
Comment on attachment 659365 [details] [diff] [review] Always consume prompt after receiving agent warning Looks good. agentErr seems like a slightly strange variable now. How about commandFailed or something?
Attachment #659365 - Flags: review?(wlachance) → review+
Comment on attachment 659367 [details] [diff] [review] Unit test Looks good to me. Note that this should land in m-c's testing/mozbase/mozdevice directory now that bug 723107 is fixed. I might just combine this with your previous patch before committing.
Attachment #659367 - Flags: review?(wlachance) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: