Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Restarting B2G before running tests, unlock screen improvements #21295

Conversation

eliperelman
Copy link
Contributor

No description provided.

@eliperelman
Copy link
Contributor Author

mozilla-b2g/marionette-device-host#1 should land and be published to npm before landing this.

@try-server-hook
Copy link

eliperelman Eli Perelman (eliperelman) started tests. Results

@try-server-hook
Copy link

eliperelman Eli Perelman (eliperelman) started tests. Results

@try-server-hook
Copy link

eliperelman Eli Perelman (eliperelman) started tests. Results

if [ $MARIONETTE_RUNNER_HOST = "marionette-device-host" ] ; then
# If we don't put some time between the b2g process restart and the
# port listeners for adb, it causes errors and premature binding
adb shell stop b2g && adb shell start b2g && sleep 2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the sleep 2, this command returns immediately and marionette-device-host will start the adb forward pretty quickly, triggering the port listener prematurely. By adding in a slight delay, we can be sure that we don't start forwarding the port right before killing the b2g process.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so I think this is why we want to move this into the host and out of the shell script. The host api is very intentionally async.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I kill B2G from marionette-device-host, then the current layout of the shell script will cause B2G to restart between every test, since marionette-device-host is instantiated with each test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh so the only intention here is to restart before running tests and not in between?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user story is confusing!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I agree, but I may have a solution in place in marionette-device-host. The goal is to restart B2G in-between each set of tests per app, but not each test per app. For example, if we are running make test-perf for Settings and Gallery, we want to restart B2G once before all the Settings tests, and once again before all the Gallery tests.

@eliperelman
Copy link
Contributor Author

Roping in @gaye.


client.executeScript(
fs.readFileSync('./tests/atoms/gaia_lock_screen.js')
+ 'GaiaLockScreen.unlock();\n');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: move binary operator up one line

@try-server-hook
Copy link

eliperelman Eli Perelman (eliperelman) started tests. Results

@hfiguiere
Copy link
Contributor

Superseded by #21450

@hfiguiere hfiguiere closed this Jul 7, 2014
@hfiguiere
Copy link
Contributor

I have picked the relevant changes for the new PR. Thanks for the help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants