You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flutter test should have a timeout at the platform plugin level #2182
flutter test was hung on the bots for 23 hours in this case. date_picker_test.dart was where the hang happened, but presumably flutter test (or package:test) needs to know how to timeout tests. package:test probably already does and we're just holding it wrong.
There are a few ways to write a test that runs forever without timing out. The timeout logic is handled entirely in the test's isolate (or iframe or process), so if it enters a synchronous infinite loop it will never time out. Also, the test runner only times out after a certain period of inactivity, which is defined based on the test's interaction with testing primitives. If it's registering new callbacks with expectAsync() or the completes or completion matcher those callbacks are firing, then it won't time out.
@nex3 In our case, there's a problem in that we don't really trust the subprocess (it's one of the things we're testing). It would be ideal if we could have the timing logic in the outer process.
Having an external timeout doesn't work very well when you want to frequently reset it from within the test. If you need one, I suggest building it into your platform plugin—if you emit a timeout error through the returned StreamChannel, the runner should handle that gracefully.
changed the title [-]`flutter test` does not appear to timeout tests?[/-][+]`flutter test` should have a timeout at the platform plugin level[/+]on Mar 25, 2016
I studied this and decided to WONTFIX it. Our bots have their own timeouts, which should be good enough to catch regressions. The test framework has timeouts to catch well-behaving slow/hung tests. There's not really a good place to put another timeout.
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.
Activity
nex3 commentedon Feb 26, 2016
There are a few ways to write a test that runs forever without timing out. The timeout logic is handled entirely in the test's isolate (or iframe or process), so if it enters a synchronous infinite loop it will never time out. Also, the test runner only times out after a certain period of inactivity, which is defined based on the test's interaction with testing primitives. If it's registering new callbacks with
expectAsync()or thecompletesorcompletionmatcher those callbacks are firing, then it won't time out.Hixie commentedon Mar 24, 2016
@nex3 In our case, there's a problem in that we don't really trust the subprocess (it's one of the things we're testing). It would be ideal if we could have the timing logic in the outer process.
nex3 commentedon Mar 25, 2016
Having an external timeout doesn't work very well when you want to frequently reset it from within the test. If you need one, I suggest building it into your platform plugin—if you emit a timeout error through the returned
StreamChannel, the runner should handle that gracefully.Hixie commentedon Mar 25, 2016
Ah, I didn't realise tests could interact with their timeouts.
[-]`flutter test` does not appear to timeout tests?[/-][+]`flutter test` should have a timeout at the platform plugin level[/+]nex3 commentedon Mar 26, 2016
Yeah, that's how it formalizes the idea of "inactivity".
Make flutter test have a 3s timeout.
eseidelGoogle commentedon Apr 20, 2016
I'm actually convinced my change to add a timeout was wrong. I believe the underlying error is that flutter does not pass https://github.com/dart-lang/sdk/blob/master/tests/isolate/handle_error2_test.dart as far as I can tell. See comments on #3366.
Hixie commentedon Dec 15, 2016
I studied this and decided to WONTFIX it. Our bots have their own timeouts, which should be good enough to catch regressions. The test framework has timeouts to catch well-behaving slow/hung tests. There's not really a good place to put another timeout.
[google_maps_flutter] Define clang module for iOS, fix analyzer warni…
github-actions commentedon Aug 8, 2021
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.