Repository navigation
Closed
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework team
Description
Noticed in a build log:
https://ci.chromium.org/ui/p/flutter/builders/try/Windows%20framework_tests_misc/56887/overview
00:07 +80: Smoke test material/color_scheme/color_scheme.0.dart
00:08 +81: Smoke test material/color_scheme/dynamic_content_color.0.dart
00:08 +82: Smoke test material/context_menu/context_menu_controller.0.dart
00:08 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#0cf43(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().
When the exception was thrown, this was the stack:
#0 State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1 State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2 _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:08 +83: Smoke test material/context_menu/editable_text_toolbar_builder.0.dart
00:08 +84: Smoke test material/context_menu/editable_text_toolbar_builder.1.dart
But this did not cause the test shard to fail. Should the build have failed here? (also we should fix the test)
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework team
Activity
goderbauer commentedon Mar 6, 2024
It's failing here:
flutter/packages/flutter_test/lib/src/binding.dart
Lines 909 to 914 in 8f84f3f
So, it is expected that it is not failing the test. I wonder why we decided to not have them fail the test execution as a whole, though.
Fix code sample failing in smoke test (#144709)
Fail tests on exceptions raised after test completed (#144706)
Reverts "Fail tests on exceptions raised after test completed (#144706)…
Reland "Fail tests on exceptions raised after test completed (#144706)…
github-actions commentedon Mar 26, 2024
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.