Commit 182b5776 authored by Julian Watson's avatar Julian Watson Committed by Commit Bot

crostini: reenable SubPagePortForwarding tests

I have a strong suspicion that the OSSettingsCrostiniPageTests were not
hanging, but instead were timing out because there were a lot of tests
under a single target, which only gets a 30 second window to run.

In crrev.com/c/2124281 the target was split up into 6 roughly equally
sized targets, of which one was disabled because we suspected that it
might be flaky. None of which have subsequently flaked.

Upon investigating the disabled test, I believe it isn't flaky, as all
of its asynchronous function invocations invoke flushAsync which cannot
timeout. Due to this, I believe it is safe to reenable, however I have
added some temporary logging, which will help us track down the cause if
it is in fact flakey.

If it doesn't flake within a week I will remove the new logging.

Bug: 1056268
Change-Id: I4d1869016642fcc26d94950aa0c138892d1df82f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2141874Reviewed-by: default avatarNic Hollingum <hollingum@google.com>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Julian Watson <juwa@google.com>
Cr-Commit-Position: refs/heads/master@{#757636}
parent 1aa19e2d
...@@ -357,6 +357,7 @@ suite('CrostiniPageTests', function() { ...@@ -357,6 +357,7 @@ suite('CrostiniPageTests', function() {
/** @type {?SettingsCrostiniPortForwarding} */ /** @type {?SettingsCrostiniPortForwarding} */
let subpage; let subpage;
setup(async function() { setup(async function() {
/*TODO(juwa): remove*/ console.log(`setting up ${this.test.title}`);
setCrostiniPrefs(true, { setCrostiniPrefs(true, {
forwardedPorts: [ forwardedPorts: [
{ {
...@@ -374,27 +375,47 @@ suite('CrostiniPageTests', function() { ...@@ -374,27 +375,47 @@ suite('CrostiniPageTests', function() {
] ]
}); });
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
settings.Router.getInstance().navigateTo( settings.Router.getInstance().navigateTo(
settings.routes.CROSTINI_PORT_FORWARDING); settings.routes.CROSTINI_PORT_FORWARDING);
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = crostiniPage.$$('settings-crostini-port-forwarding'); subpage = crostiniPage.$$('settings-crostini-port-forwarding');
assertTrue(!!subpage); assertTrue(!!subpage);
/*TODO(juwa): remove*/ console.log(`setup ${this.test.title}`);
}); });
test('Forwarded ports are shown', function() { test('Forwarded ports are shown', function() {
/*TODO(juwa): remove*/ console.log(`running ${this.test.title}`);
// Extra list item for the titles. // Extra list item for the titles.
assertEquals( assertEquals(
3, subpage.shadowRoot.querySelectorAll('.list-item').length); 3, subpage.shadowRoot.querySelectorAll('.list-item').length);
/*TODO(juwa): remove*/ console.log(`ran ${this.test.title}`);
}); });
test('AddPortSuccess', async function() { test('AddPortSuccess', async function() {
/*TODO(juwa): remove*/ console.log(`running ${this.test.title}`);
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = crostiniPage.$$('settings-crostini-port-forwarding'); subpage = crostiniPage.$$('settings-crostini-port-forwarding');
subpage.$$('#addPort cr-button').click(); subpage.$$('#addPort cr-button').click();
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = subpage.$$('settings-crostini-add-port-dialog'); subpage = subpage.$$('settings-crostini-add-port-dialog');
const portNumberInput = subpage.$$('#portNumberInput'); const portNumberInput = subpage.$$('#portNumberInput');
portNumberInput.value = '5000'; portNumberInput.value = '5000';
...@@ -403,14 +424,24 @@ suite('CrostiniPageTests', function() { ...@@ -403,14 +424,24 @@ suite('CrostiniPageTests', function() {
subpage.$$('cr-dialog cr-button[id="continue"]').click(); subpage.$$('cr-dialog cr-button[id="continue"]').click();
assertEquals( assertEquals(
1, crostiniBrowserProxy.getCallCount('addCrostiniPortForward')); 1, crostiniBrowserProxy.getCallCount('addCrostiniPortForward'));
/*TODO(juwa): remove*/ console.log(`ran ${this.test.title}`);
}); });
test('AddPortFail', async function() { test('AddPortFail', async function() {
/*TODO(juwa): remove*/ console.log(`running ${this.test.title}`);
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = crostiniPage.$$('settings-crostini-port-forwarding'); subpage = crostiniPage.$$('settings-crostini-port-forwarding');
subpage.$$('#addPort cr-button').click(); subpage.$$('#addPort cr-button').click();
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = subpage.$$('settings-crostini-add-port-dialog'); subpage = subpage.$$('settings-crostini-add-port-dialog');
const portNumberInput = subpage.$$('#portNumberInput'); const portNumberInput = subpage.$$('#portNumberInput');
portNumberInput.value = 'INVALID_PORT_NUMBER'; portNumberInput.value = 'INVALID_PORT_NUMBER';
...@@ -427,21 +458,36 @@ suite('CrostiniPageTests', function() { ...@@ -427,21 +458,36 @@ suite('CrostiniPageTests', function() {
subpage.$$('cr-dialog cr-button[id="continue"]').click(); subpage.$$('cr-dialog cr-button[id="continue"]').click();
assertEquals( assertEquals(
1, crostiniBrowserProxy.getCallCount('addCrostiniPortForward')); 1, crostiniBrowserProxy.getCallCount('addCrostiniPortForward'));
/*TODO(juwa): remove*/ console.log(`ran ${this.test.title}`);
}); });
test('AddPortCancel', async function() { test('AddPortCancel', async function() {
/*TODO(juwa): remove*/ console.log(`running ${this.test.title}`);
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = crostiniPage.$$('settings-crostini-port-forwarding'); subpage = crostiniPage.$$('settings-crostini-port-forwarding');
subpage.$$('#addPort cr-button').click(); subpage.$$('#addPort cr-button').click();
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = subpage.$$('settings-crostini-add-port-dialog'); subpage = subpage.$$('settings-crostini-add-port-dialog');
subpage.$$('cr-dialog cr-button[id="cancel"]').click(); subpage.$$('cr-dialog cr-button[id="cancel"]').click();
/*TODO(juwa): remove*/ console.log(
`before flushAsync ${this.test.title}`);
await flushAsync(); await flushAsync();
/*TODO(juwa): remove*/ console.log(
`after flushAsync ${this.test.title}`);
subpage = crostiniPage.$$('settings-crostini-port-forwarding'); subpage = crostiniPage.$$('settings-crostini-port-forwarding');
assertTrue(!!subpage); assertTrue(!!subpage);
/*TODO(juwa): remove*/ console.log(`ran ${this.test.title}`);
}); });
}); });
......
...@@ -490,10 +490,9 @@ TEST_F('OSSettingsCrostiniPageTest', 'SubPageDefault', function() { ...@@ -490,10 +490,9 @@ TEST_F('OSSettingsCrostiniPageTest', 'SubPageDefault', function() {
mocha.grep('SubPageDefault').run(); mocha.grep('SubPageDefault').run();
}); });
TEST_F( TEST_F('OSSettingsCrostiniPageTest', 'SubPagePortForwarding', function() {
'OSSettingsCrostiniPageTest', 'DISABLED_SubPagePortForwarding', function() { mocha.grep('SubPagePortForwarding').run();
mocha.grep('SubPagePortForwarding').run(); });
});
TEST_F('OSSettingsCrostiniPageTest', 'DiskResize', function() { TEST_F('OSSettingsCrostiniPageTest', 'DiskResize', function() {
mocha.grep('DiskResize').run(); mocha.grep('DiskResize').run();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment