Closed Bug 1090962 Opened 9 years ago Closed 9 years ago

If a test is skipped before a session is created, reporting mixin's gather_debug will fail when it tries to use the Marionette session


(Remote Protocol :: Marionette, defect)

Not set


(Not tracked)



(Reporter: zcampbell, Assigned: zcampbell)




(3 files)

1. Test is skipped in the setUp, but before MarionetteTestCase.setUp() has been called, 
2. MarionetteTestCase.tearDown() will then try to use a marionette session.

The logs are polluted with Marionette exceptions ("Please start a session")

I can't see any ill effects in this scenario but the assumption that a session is running should probably be avoided.

Attachment is of the polluted log.

The test that is causing that error in the log is:
Zac and I just talked on IRC about this. I don't think the issue is new, but recent changes have made it noisier. Basically we're trying to gather debug if the test does not pass (so that includes tests that are skipped if not done by manifest). It will have no harm because the gathering of debug is already in a try/except, but we should reduce the noise.

We could exclude skipped tests from gathering debug (there is little point as these will likely have no useful information), but it would also make sense to check we have a Marionette session before we attempt to gather any debug. Here are the places this would need to be fixed:
Possibly in the future the reason for the skip could be useful in the debug so I think we should still debug the test even if it's empty.

At the very least checking for the marionette session will remove the console noise so I'll start with a patch for that and we can go from there.
Assignee: nobody → zcampbell
Attachment #8515977 - Flags: review?(dave.hunt)
Attachment #8515970 - Flags: feedback?(cmanchester)
Comment on attachment 8515970 [details] [diff] [review]

Looks good, thanks!
Attachment #8515970 - Flags: review?(dave.hunt) → review+
Attachment #8515977 - Flags: review?(dave.hunt) → review+
Comment on attachment 8515970 [details] [diff] [review]

Review of attachment 8515970 [details] [diff] [review]:

Looks good to me, thanks!
Attachment #8515970 - Flags: feedback?(cmanchester) → feedback+
Thanks Dave and Chris.
Keywords: checkin-needed
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.