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

Errors Encountered During Flutter Tests #646

Open
badnikhil opened this issue Mar 9, 2025 · 1 comment
Open

Errors Encountered During Flutter Tests #646

badnikhil opened this issue Mar 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@badnikhil
Copy link

Describe the bug/problem

When running flutter test, the following errors are encountered:

  1. Pending Timer Error

    • Exception:
      ═╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════
      The following assertion was thrown running a test:
      A Timer is still pending even after the widget tree was disposed.
      'package:flutter_test/src/binding.dart':
      Failed assertion: line 1606 pos 12: '!timersPending'
      
    • Possible Cause:
      A timer remains active after the widget tree has been disposed.
  2. Late Initialization Error

    • Exception:
      ═╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═
      The following LateError was thrown while finalizing the widget tree:
      LateInitializationError: Field '_videoController@28198544' has not been initialized.
      
    • Possible Cause:
      The _videoController field is not properly initialized before usage, leading to this error during widget disposal.

Steps to Reproduce the bug/problem

  1. Open the project in a preferred IDE (e.g., VS Code, Android Studio).
  2. Run the command:
    flutter test

Expected behavior

The tests should pass successfully without encountering Pending Timer or LateInitializationError issues.

Device Info (The device where you encountered this issue)

  • OS: Ubuntu 24.04.1 LTS

Additional Notes

  • I discussed this with a experienced flutter dev and he concluded that the latetimer error is related to the video_player package (version 2.9.3) Not the project Codebase
  • The late initialization error might indicate that _videoController should be initialized earlier in the widget -lifecycle (e.g., inside initState).
@badnikhil
Copy link
Author

The late inititlisation error is fixed in PR #647 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant