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

chore: migrate from timeouts to deadlines internally #1695

Merged
merged 1 commit into from
Apr 7, 2020

Conversation

pavelfeldman
Copy link
Member

Addresses timeout aspect of #1669

Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

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

Looks good overall.

src/frames.ts Outdated
@@ -760,8 +763,8 @@ export class Frame {
const task = async (context: dom.FrameExecutionContext) => context.evaluateHandleInternal(({ injected, predicateBody, polling, timeout, arg }) => {
const innerPredicate = new Function('arg', predicateBody);
return injected.poll(polling, timeout, () => innerPredicate(arg));
}, { injected: await context._injected(), predicateBody, polling, timeout, arg });
return this._scheduleRerunnableTask(task, 'main', timeout) as any as types.SmartHandle<R>;
}, { injected: await context._injected(), predicateBody, polling, timeout: deadline - helper.monotonicTime(), arg });
Copy link
Contributor

Choose a reason for hiding this comment

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

helper.timeUntilDeadline?

src/frames.ts Outdated
this._timeoutTimer = setTimeout(() => this.terminate(timeoutError), timeout);
}
const timeoutError = new TimeoutError(`waiting for ${title || 'function'} failed: timeout exceeded`);
this._timeoutTimer = setTimeout(() => this.terminate(timeoutError), deadline - helper.monotonicTime());
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@pavelfeldman pavelfeldman force-pushed the deadline branch 2 times, most recently from 9516af5 to 9d559e3 Compare April 7, 2020 21:02
@pavelfeldman pavelfeldman merged commit c6f580f into microsoft:master Apr 7, 2020
@pavelfeldman pavelfeldman deleted the deadline branch April 17, 2020 21:12
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.

2 participants