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

[web] Fix leaking canvas in text placeholder tests #21253

Closed
wants to merge 1 commit into from

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Sep 17, 2020

Description

The text placeholder test used to leak canvases which led to errors in iOS Safari because it stops creating canvases after some time. This PR fixes the leakage.

cc @ferhatb to confirm this is the right way to fix the leakage.

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Sep 17, 2020
@mdebbar mdebbar self-assigned this Sep 17, 2020
@@ -39,6 +40,7 @@ void testMain() async {
);
offset = offset.translate(0.0, 80.0);
}
recordingCanvas.restore();
Copy link
Contributor

Choose a reason for hiding this comment

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

i just see save/restore pairs. why was it leaking when restore is not called ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of the way canvas pool works lazily now? I saw you added restore calls in multiple tests: #15153

@@ -104,7 +104,7 @@ class IosSafariArgParser extends BrowserArgParser {
);
} catch (e) {
throw Exception('Error getting requested simulator. Try running '
'`felt create` command first before running the tests. Exception: '
'`felt create_simulator` command first before running the tests. Exception: '
Copy link
Contributor

Choose a reason for hiding this comment

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

:D thanks!

Copy link
Contributor

@nturgut nturgut left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the tests. Shall we upload the goldens to the repo? We can even change reference sha in this PR since LUCI is not running them now.

@@ -397,7 +397,8 @@ class TestCommand extends Command<bool> with ArgUtils {
// after solving the git issue faced on macOS and Windows bots:
// TODO: https://github.com/flutter/flutter/issues/63710
if ((isChrome && isLuci && io.Platform.isLinux) ||
((isChrome || isSafariIOS) && !isLuci)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove this part for now :) I didn't merged the recipe change

@mdebbar
Copy link
Contributor Author

mdebbar commented Sep 18, 2020

Never mind. This PR doesn't fix anything. The tests started passing for me on master, but failing for Nurhan. Filed an issue: flutter/flutter#66129

@mdebbar mdebbar closed this Sep 18, 2020
@mdebbar mdebbar deleted the canvas_leak branch April 15, 2021 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants