Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip flaky tests on Chrome 71 + Windows 10 #19926

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

import {createPointerEvent} from '../../../../../testing/test-helper';

const config = describe.configure().ifChrome();
config.run('amp-image-slider', function() {
const t = describe.configure()
.ifChrome()
.skipWindows(); // TODO(#19647): Flaky on Chrome 71 on Windows 10.

t.run('amp-image-slider', function() {
this.timeout(20000);
const DEFAULT_TIMEOUT = 1600;

Expand Down
8 changes: 8 additions & 0 deletions src/service/platform-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ export class Platform {
return /WebKit/i.test(this.navigator_.userAgent) && !this.isEdge();
}

/**
* Whether the current browser is running on Windows.
* @return {boolean}
*/
isWindows() {
return /Windows/i.test(this.navigator_.userAgent);
Copy link
Member

Choose a reason for hiding this comment

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

image

}

/**
* Whether the current browser is isStandalone.
* @return {boolean}
Expand Down
4 changes: 4 additions & 0 deletions test/_init_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ class TestConfig {
});
}

skipWindows() {
return this.skip(() => this.platform.isWindows());
}

enableIe() {
this.skipMatchers.splice(this.skipMatchers.indexOf(this.runOnIe), 1);
return this;
Expand Down
8 changes: 6 additions & 2 deletions test/integration/test-amp-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
* limitations under the License.
*/

const config = describe.configure().ifChrome().skipSinglePass();
config.run('amp-carousel', function() {
const t = describe.configure()
.ifChrome()
.skipSinglePass()
.skipWindows(); // TODO(#19647): Flaky on Chrome 71 on Windows 10.

t.run('amp-carousel', function() {
this.timeout(10000);

const extensions = ['amp-carousel'];
Expand Down
10 changes: 6 additions & 4 deletions test/integration/test-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import {
/** @const {number} */
const TIMEOUT = window.ampTestRuntimeConfig.mochaTimeout;

// TODO(@cramforce): Find out why it does not work with obfuscated
// props.
const t = describe.configure().retryOnSaucelabs()
.skipIfPropertiesObfuscated();
const t = describe.configure()
.retryOnSaucelabs()
// TODO(@cramforce): Find out why it does not work with obfuscated props.
.skipIfPropertiesObfuscated()
.skipWindows(); // TODO(#19647): Flaky on Chrome 71 on Windows 10.

t.run('error page', function() {
this.timeout(TIMEOUT);

Expand Down
181 changes: 92 additions & 89 deletions test/integration/test-user-error-reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,104 +16,107 @@

import {RequestBank} from '../../testing/test-helper';

describe.configure().skipIfPropertiesObfuscated()
.skipSafari().skipEdge().run('user-error', function() {
//TODO(zhouyx, #11459): Unskip the test on safari.
const t = describe.configure()
.skipIfPropertiesObfuscated()
.skipSafari() // TODO(zhouyx, #11459): Unskip the test on safari.
.skipEdge()
.skipWindows(); // TODO(#19647): Flaky on Chrome 71 on Windows 10.

describes.integration('user-error integration test', {
extensions: ['amp-analytics'],
hash: 'log=0',
experiments: ['user-error-reporting'],
body: `
<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
}
t.run('user-error', function() {
describes.integration('user-error integration test', {
extensions: ['amp-analytics'],
hash: 'log=0',
experiments: ['user-error-reporting'],
body: `
<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
</script>
</amp-analytics>
}
}
</script>
</amp-analytics>

<amp-pixel src="https://foo.com/tracker/foo"
referrerpolicy="fail-referrer">
`,
}, () => {
it('should ping correct host with amp-pixel user().assert err', () => {
return RequestBank.withdraw();
});
});
<amp-pixel src="https://foo.com/tracker/foo"
referrerpolicy="fail-referrer">
`,
}, () => {
it('should ping correct host with amp-pixel user().assert err', () => {
return RequestBank.withdraw();
});
});

describes.integration('user-error integration test', {
extensions: ['amp-analytics'],
hash: 'log=0',
experiments: ['user-error-reporting'],
describes.integration('user-error integration test', {
extensions: ['amp-analytics'],
hash: 'log=0',
experiments: ['user-error-reporting'],

body: `
<amp-img
src="../../examples/img/sea@1x.jpg"
width="360" height="216" layout="responsive"
role='img'>
</amp-img>
body: `
<amp-img
src="../../examples/img/sea@1x.jpg"
width="360" height="216" layout="responsive"
role='img'>
</amp-img>

<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
}
<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
</script>
</amp-analytics>`,
}, () => {
it('should ping correct host with amp-img user().error err', () => {
return RequestBank.withdraw();
});
});
}
}
</script>
</amp-analytics>`,
}, () => {
it('should ping correct host with amp-img user().error err', () => {
return RequestBank.withdraw();
});
});

describes.integration('3p user-error integration test', {
extensions: ['amp-analytics', 'amp-ad'],
hash: 'log=0',
experiments: ['user-error-reporting'],
describes.integration('3p user-error integration test', {
extensions: ['amp-analytics', 'amp-ad'],
hash: 'log=0',
experiments: ['user-error-reporting'],

body: `
<amp-ad width=300 height=250
type="_ping_"
data-url='not-exist'
data-valid='false'
data-error='true'>
</amp-ad>
body: `
<amp-ad width=300 height=250
type="_ping_"
data-url='not-exist'
data-valid='false'
data-error='true'>
</amp-ad>

<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
}
<amp-analytics>
<script type="application/json">
{
"requests": {
"error": "${RequestBank.getUrl()}"
},
"triggers": {
"userError": {
"on": "user-error",
"request": "error"
}
</script>
</amp-analytics>`,
}, () => {
it('should ping correct host with 3p error message', () => {
return RequestBank.withdraw();
});
});
}
}
</script>
</amp-analytics>`,
}, () => {
it('should ping correct host with 3p error message', () => {
return RequestBank.withdraw();
});
});
});
8 changes: 6 additions & 2 deletions test/integration/test-video-players-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ export function runVideoPlayerIntegrationTests(
afterEach(cleanUp);
});

describe.configure().skipIfPropertiesObfuscated()
.ifChrome().run('Analytics Triggers', function() {
describe.configure()
.skipIfPropertiesObfuscated()
.ifChrome()
.skipWindows() // TODO(#19647): Flaky on Chrome 71 on Windows 10.
.run('Analytics Triggers', function() {
this.timeout(TIMEOUT);
let video;

Expand Down Expand Up @@ -342,6 +345,7 @@ export function runVideoPlayerIntegrationTests(

afterEach(cleanUp);
});

const t = describe.configure().ifChrome().skipIfPropertiesObfuscated();
t.run('Autoplay', function() {
this.timeout(TIMEOUT);
Expand Down
Loading