If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Re-use secondary emulators

RESOLVED FIXED in mozilla15

Status

Testing
Marionette
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jgriffin, Assigned: jgriffin)

Tracking

unspecified
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Currently, we launch a new emulator every time a test calls get_new_emulator().  If we run three tests in a row that do this, each one launches an emulator, which gets closed at the end of the test.

Instead, we should cache these extra emulators and re-use them.
(Assignee)

Comment 1

5 years ago
Created attachment 622239 [details] [diff] [review]
patch

The reason tests are modified as part of this patch is that they need to clean up after themselves since they're no longer being run in single-use emulators.
Attachment #622239 - Flags: review?(mdas)
Comment on attachment 622239 [details] [diff] [review]
patch

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

::: testing/marionette/client/marionette/marionette_test.py
@@ +60,5 @@
>  class MarionetteTestCase(CommonTestCase):
>  
>      def __init__(self, marionette, methodName='runTest'):
>          self.marionette = marionette
> +        self.extra_emulator_index = 0

I find it confusing to set self.extra_emulator_index to 0 when there isn't an extra emulator yet, can we rename self.extra_emulator_index to self.extra_emulators, or something without the word index in it?

Then the indices between self.extra_emulators and self.marionette.extra_emulators would match.
Attachment #622239 - Flags: review?(mdas) → review+
(Assignee)

Comment 3

5 years ago
(In reply to Malini Das [:mdas] from comment #2)
> Comment on attachment 622239 [details] [diff] [review]
> patch
> 
> Review of attachment 622239 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: testing/marionette/client/marionette/marionette_test.py
> @@ +60,5 @@
> >  class MarionetteTestCase(CommonTestCase):
> >  
> >      def __init__(self, marionette, methodName='runTest'):
> >          self.marionette = marionette
> > +        self.extra_emulator_index = 0
> 
> I find it confusing to set self.extra_emulator_index to 0 when there isn't
> an extra emulator yet, can we rename self.extra_emulator_index to
> self.extra_emulators, or something without the word index in it?
> 
> Then the indices between self.extra_emulators and
> self.marionette.extra_emulators would match.

I changed the meaning of self.extra_emulator_index so it matches the real index value.

http://hg.mozilla.org/mozilla-central/rev/d6b1898a8eb7
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.