Skip to content

flutter test should have a timeout at the platform plugin level #2182

Closed

Description

@eseidelGoogle

See #2181

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.

@abarth @nex3 @yjbanov

Activity

  1. nex3 commented on Feb 26, 2016

    @nex3

    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.

  2. Hixie commented on Mar 24, 2016

    @Hixie
    Contributor

    @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.

  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Mar 24, 2016
  4. added this to the milestone on Mar 24, 2016
  5. nex3 commented on Mar 25, 2016

    @nex3

    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.

  6. Hixie commented on Mar 25, 2016

    @Hixie
    Contributor

    Ah, I didn't realise tests could interact with their timeouts.

  7. 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
  8. nex3 commented on Mar 26, 2016

    @nex3

    Yeah, that's how it formalizes the idea of "inactivity".

  9. eseidelGoogle commented on Apr 20, 2016

    @eseidelGoogle
    ContributorAuthor

    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.

  10. added
    a: tests"flutter test", flutter_test, or one of our tests
    on Apr 21, 2016
  11. self-assigned this
    on Dec 15, 2016
  12. Hixie commented on Dec 15, 2016

    @Hixie
    Contributor

    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.

  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

Labels

a: tests"flutter test", flutter_test, or one of our teststoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions