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: rework disposers into a frame task #1413

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

pavelfeldman
Copy link
Member

No description provided.

@@ -897,7 +897,6 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
await page.$eval('iframe', frame => frame.remove());
const error = await navigationPromise;
expect(error.message).toContain('frame was detached');
expect(error.stack).toContain('Frame.goto')
Copy link
Contributor

Choose a reason for hiding this comment

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

this was very important for debugging.

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked at the stacks without it and it does look very straightforward. Could you give an example that was good and is now puzzling?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not as bad as it once was, because the async stack traces help us at least get the client code that called this. But lacking the playwright method you called in the stack trace is not great.

this.done();
if (this._url)
error.message = error.message + ` while navigating to ${this._url}`;
throw error;
Copy link
Contributor

Choose a reason for hiding this comment

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

Never throw someone else's error to avoid hiding your stack trace.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not avoiding, but I don't think stack matters much here. I don't want to instanceof TimeoutError and rewrite its message - that sounds lame...


if (!error)
return result!;
this.done();
Copy link
Contributor

Choose a reason for hiding this comment

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

Calling done() at the right time is a bit tricky. Returning error was easier in that regard.

@dgozman
Copy link
Contributor

dgozman commented Mar 19, 2020

Seems like a marginal improvement. If we were to somehow simplify fooWatchers as well, that would be very helpful.

@pavelfeldman pavelfeldman merged commit 2af07ce into microsoft:master Mar 19, 2020
@pavelfeldman pavelfeldman deleted the frame_task branch April 17, 2020 21:13
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