Repository navigation
flutter_tester --non-interactive should never call beginFrame/drawFrame #178
Description
Activity
- addeda: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our tests
on Nov 9, 2015 I've temporarily worked around this in some of the tests by disconnecting the binding's hook into the engine, but that's not a good long-term solution.
- addedc: contributor-productivityTeam-specific productivity, code health, technical debt.Team-specific productivity, code health, technical debt.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
on Dec 12, 2015 @chinmaygarde This bug may be of interest to you. Happy to chat about it if you want.
BeginFrameshould only be called if a frame is actually requested. If not, this is likely a bug in the engine. I will can verify it tomorrow.Oh, cool. I may be able to simplify the test harness then. (This bug is old, it may have changed since I filed it.)
@chinmaygarde Looks like the engine is still canning window.onBeginFrame during headless
flutter test.To check, I edited
packages/flutter_test/lib/src/binding.dart; in theinitInstancesmethod of theAutomatedTestWidgetsFlutterBindingclass, I changed the last line to:ui.window.onBeginFrame = (Duration timestamp) { print('engine called onBeginFrame!'); };
Then I ran
flutter testin theflutter_testdirectory, and observed that it calls that print statement. By checking the stack trace that that closure gets called with (usingdebugPrintStack) I verified that it is coming from calls to_beginFrame.- modified the milestones: This milestone has been deleted, This milestone has been deleted
on Jan 26, 2017 - changed the title
[-]sky_shell --non-interactive should never call beginFrame[/-][+]flutter_tester --non-interactive should never call beginFrame[/+]on May 30, 2017 - changed the title
[-]flutter_tester --non-interactive should never call beginFrame[/-][+]flutter_tester --non-interactive should never call beginFrame/drawFrame[/+]on May 30, 2017 We have decided we're fine with the current situation either way.
- added a commit that references this issue
on Mar 21, 2019 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Aug 8, 2021
Friday Oct 02, 2015 at 18:21 GMT
Originally opened as https://github.com/flutter/engine/issues/1457
Running the tests directly, as opposed to through the test harness, you get exceptions because the animation code is getting called from beginFrame() which is being called from the engine directly with a different clock time than the fake clock the test is trying to run the system with.