-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fail tests on exceptions raised after test completed #144706
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
Fail tests on exceptions raised after test completed #144706
Conversation
|
The failing checks are the reason for his PR, they used to be silent and went undetected. The failures will go away with the fix in #144709. |
039638b to
aa371fe
Compare
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.
Verified in #144785 that the new test is indeed failing on current tip of tree without these changes.
Piinks
left a comment
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.
27f00b8 to
4c4804d
Compare
4c4804d to
a8b03bd
Compare
|
A reason for requesting a revert of flutter/flutter/144706 could |
|
Reason for revert: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing. |
This reverts commit 91cccc8.
…" (#144970) Reverts: #144706 Initiated by: gspencergoog Reason for reverting: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing. Original PR Author: goderbauer Reviewed By: {Piinks} This change reverts the following previous change: A test was failing silently because of this (see #144353 and fixed in #144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows: ``` 00:03 +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#1cd37(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:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart 00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E] Test failed. See exception logs above. The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart This test failed after it had already completed. Make sure to use a matching library which informs the test runner of pending async work. ```
|
@gspencergoog Can you list the failing tests here so @goderbauer (or people doing archeology) can follow the breadcrumb trail? Thanks! |
|
Failure for prosperity included below. Looks like the test is missing an await, which is fixed by #144978. |
Manual roll requested by [email protected] flutter/flutter@3bb2e59...1ca8873 2024-03-12 [email protected] Update integration tests regexes. (flutter/flutter#144847) 2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fail tests on exceptions raised after test completed (#144706)" (flutter/flutter#144970) 2024-03-11 [email protected] Make TabController communicating creation in constructor. (flutter/flutter#144912) 2024-03-11 [email protected] Fail tests on exceptions raised after test completed (flutter/flutter#144706) 2024-03-11 [email protected] Refactoring `if` chains into `switch` statements (flutter/flutter#144905) 2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Expose build mode in environment of asset transformer processes (#144752)" (flutter/flutter#144957) 2024-03-11 [email protected] Expose build mode in environment of asset transformer processes (flutter/flutter#144752) 2024-03-11 [email protected] Roll Flutter Engine from 9196947bc687 to 6745955bb49e (2 revisions) (flutter/flutter#144946) 2024-03-11 [email protected] Skip test temporarily until headingLevel is added in engine (issue 41� (flutter/flutter#135077) 2024-03-11 [email protected] Roll Flutter Engine from 3b0b59bb224d to 9196947bc687 (1 revision) (flutter/flutter#144934) 2024-03-11 [email protected] Roll Packages from 0badb43 to d489d84 (3 revisions) (flutter/flutter#144931) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
I did actually list them in the revert PR at #144970 (comment) But I suppose I could have posted them here too. |

A test was failing silently because of this (see #144353 and fixed in #144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so.
package:testcan properly handle reported exceptions outside of test cases. With this change, the test fails as follows: