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

Wait for the first authorization to complete before sending pingback #1350

Merged
merged 1 commit into from
Jan 8, 2016

Conversation

dvoytenko
Copy link
Contributor

No description provided.

@cramforce
Copy link
Member

LGTM

dvoytenko added a commit that referenced this pull request Jan 8, 2016
Wait for the first authorization to complete before sending pingback
@dvoytenko dvoytenko merged commit d24f0b2 into ampproject:master Jan 8, 2016
@dvoytenko dvoytenko deleted the access9 branch January 8, 2016 03:01
});
return Promise.resolve().then(() => {
expect(resolved).to.be.false;
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a non-deterministic test. It'd be better to return the service.firstAuthorizationPromise_ like:

return service.firstAuthorizationPromise_.then(() => {
  throw new Error('should not have resolved');
}, () => {
  assert(true);
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be correct in the micro-task order, no? The issue here is that it's supposed to be never resolved - this would crash the test with timeout.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, see #1350 (comment). A rejected promise never fulfills, fixing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants