-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Ad test failures #8969
Ad test failures #8969
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ describe('amp-ad-3p-impl', () => { | |
let sandbox; | ||
let ad3p; | ||
let win; | ||
const whenFirstVisible = Promise.resolve(); | ||
|
||
beforeEach(() => { | ||
sandbox = sinon.sandbox.create(); | ||
|
@@ -57,7 +58,7 @@ describe('amp-ad-3p-impl', () => { | |
ad3p.buildCallback(); | ||
// Turn the doc to visible so prefetch will be proceeded. | ||
stubService(sandbox, win, 'viewer', 'whenFirstVisible') | ||
.returns(Promise.resolve()); | ||
.returns(whenFirstVisible); | ||
}); | ||
}); | ||
|
||
|
@@ -179,10 +180,10 @@ describe('amp-ad-3p-impl', () => { | |
}); | ||
|
||
describe('preconnectCallback', () => { | ||
it('should add preconnect and prefech to DOM header', done => { | ||
it('should add preconnect and prefech to DOM header', () => { | ||
ad3p.buildCallback(); | ||
ad3p.preconnectCallback(); | ||
setTimeout(() => { | ||
return whenFirstVisible.then(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the reason why the test is flaky? I can't see why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow! that's a good catch!!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jridgewell could you further explain what does "setTimeout is throttled" mean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chrome throttles weirdly. 🤷♂️ |
||
let fetches = win.document.querySelectorAll('link[rel=prefetch]'); | ||
if (!fetches.length) { | ||
fetches = win.document.querySelectorAll('link[rel=preload]'); | ||
|
@@ -197,8 +198,7 @@ describe('amp-ad-3p-impl', () => { | |
win.document.querySelectorAll('link[rel=preconnect]'); | ||
expect(preconnects[preconnects.length - 1]).to.have.property('href', | ||
'https://testsrc/'); | ||
done(); | ||
}, 0); | ||
}); | ||
}); | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about we only skip it on old chrome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this to make A4A fix it faster. 😈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. so 😈 !