Skip to content

flutter_tester --non-interactive should never call beginFrame/drawFrame #178

Description

@FlutterIssues

Issue by Hixie
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.

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    on Nov 9, 2015
  2. Hixie commented on Nov 23, 2015

    @Hixie
    Contributor

    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.

  3. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    engineflutter/engine related. See also e: labels.
    on Dec 12, 2015
  4. added this to the milestone on Dec 12, 2015
  5. Hixie commented on Dec 9, 2016

    @Hixie
    Contributor

    @chinmaygarde This bug may be of interest to you. Happy to chat about it if you want.

  6. chinmaygarde commented on Dec 9, 2016

    @chinmaygarde
    Contributor

    BeginFrame should 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.

  7. Hixie commented on Dec 9, 2016

    @Hixie
    Contributor

    Oh, cool. I may be able to simplify the test harness then. (This bug is old, it may have changed since I filed it.)

  8. Hixie commented on Jan 24, 2017

    @Hixie
    Contributor

    @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 the initInstances method of the AutomatedTestWidgetsFlutterBinding class, I changed the last line to:

        ui.window.onBeginFrame = (Duration timestamp) { print('engine called onBeginFrame!'); };

    Then I ran flutter test in the flutter_test directory, and observed that it calls that print statement. By checking the stack trace that that closure gets called with (using debugPrintStack) I verified that it is coming from calls to _beginFrame.

  9. modified the milestones: , on Jan 26, 2017
  10. changed the title [-]sky_shell --non-interactive should never call beginFrame[/-] [+]flutter_tester --non-interactive should never call beginFrame[/+] on May 30, 2017
  11. changed the title [-]flutter_tester --non-interactive should never call beginFrame[/-] [+]flutter_tester --non-interactive should never call beginFrame/drawFrame[/+] on May 30, 2017
  12. Hixie commented on May 30, 2017

    @Hixie
    Contributor

    We have decided we're fine with the current situation either way.

  13. github-actions commented on Aug 8, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: contributor-productivityTeam-specific productivity, code health, technical debt.engineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions