-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Fix leaking canvas in text placeholder tests #21253
Conversation
@@ -39,6 +40,7 @@ void testMain() async { | |||
); | |||
offset = offset.translate(0.0, 80.0); | |||
} | |||
recordingCanvas.restore(); |
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 just see save/restore pairs. why was it leaking when restore is not called ?
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.
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: ' |
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.
:D thanks!
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.
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)) { |
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.
can you remove this part for now :) I didn't merged the recipe change
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 |
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.