Closed Bug 1040742 Opened 10 years ago Closed 9 years ago

MarionetteTestCase should not try to delete_session/call the server if a crash has occurred

Categories

(Testing :: Marionette Client and Harness, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: zcampbell, Assigned: impossibus)

References

Details

(Keywords: pi-marionette-client, pi-marionette-runner, Whiteboard: [affects=gaia][affects=b2g])

Attachments

(2 files)

If a crash has occurred in b2g and tearDown has been called then the tearDown will fail because the marionette server is not up.

Seeing as MarionetteTestCase can/will detect when a crash has occurred, we can use this to conditionally execute the remainder of MarionetteTestCase.tearDown.

Put simply, if a crash has occurred we should not make any more calls to the marionette server and cleanup, but still do cleanup inside MarionetteTestCase where required.
Summary: MarionetteTestCase should not try to delete/tearDown if a crash has occurred. → MarionetteTestCase should not try to delete_session/call the server if a crash has occurred
Whiteboard: [affects=webqa]
What is the error that you get? Looking at the code it should handle there being no marionette server to speak to.

Do you know if there is a way to guarantee a crash?
Flags: needinfo?(zcampbell)
Just running this again, I think some recent changes to mozrunner and so forth have changed the way test failures are reported so I don't see tearDown failures reported any more. However the code does still exist, here:

http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/marionette_test.py#548

you can loosely replicate a crash by doing `adb shell stop b2g` while a test is running.

Running with a known crasher I can see it may affect logging too as TEST-END is not executed when the crash occurs.

Some logging depends on this so it may be two bugs here; one to remove marionette calls from tearDown and another to log correctly even after a crash.
Flags: needinfo?(zcampbell)
Whiteboard: [affects=webqa] → [affects=gaia][affects=b2g]
Attached patch bug_1040742.diff (deleted) — Splinter Review
Attachment #8500964 - Flags: review?(dave.hunt)
NB - this won't do anything because check_for_crashes doesn't execute when testing against device.
Depends on: 1038868
Comment on attachment 8500964 [details] [diff] [review]
bug_1040742.diff

Review of attachment 8500964 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/marionette/client/marionette/marionette_test.py
@@ +542,5 @@
>          self.marionette.execute_script("log('TEST-START: %s:%s')" %
>                                         (self.filepath.replace('\\', '\\\\'), self.methodName))
>  
>      def tearDown(self):
> +        if not self.marionette.check_for_crash():

This will only return true if it detects a crash in this call. If a crash has previously been detected then this may return false. We now keep track of crashes in mozrunner (see bug 1075647) but we'll need a mozrunner release and bug 1038868 fixed before we can revisit this patch.
Attachment #8500964 - Flags: review?(dave.hunt) → review-
OK, makes sense.

If we keep track of crashes in mozrunner does it make the check_for_crashes method redundant?
(In reply to Zac C (:zac) from comment #7)
> If we keep track of crashes in mozrunner does it make the check_for_crashes
> method redundant?

No, we still need to check for crashes. The change in mozrunner just keeps track of crashes detected when calling check_for_crashes.
It looks like this got fixed in Bug 1141519, but we might want to catch a specific exception when logging test-end fails.
Bug 1040742: Only ignore expected exceptions; r?automatedtester
Attachment #8669995 - Flags: review?(dburns)
Comment on attachment 8669995 [details]
MozReview Request: Bug 1040742: Only ignore expected exceptions; r?automatedtester

https://reviewboard.mozilla.org/r/21313/#review19221
Attachment #8669995 - Flags: review?(dburns) → review+
Assignee: nobody → mjzffr
https://hg.mozilla.org/mozilla-central/rev/373d69235038
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Product: Testing → Remote Protocol

Moving bugs for Marionette client due to component changes.

Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: