Skip to content

Start running tests with --test-randomize-ordering-seed=random #47233

Closed

Description

@dnfield

We should shuffle our tests. I've encountered a number of test files that depend on state set by previous tests. This ends up hiding bugs and/or creating unnecessary breaking changes later on when we have to fix it.

Package test takes an argument --test-randomize-ordering-seed=random. For regular test runs this looks like pub run test --test-randomize-ordering-seed=random. For flutter test we'll have to create a way to pipe in the argument. In general, we'll want to update dev/bots/test.dart to use this argument by default when running tests for CI.

/cc @jonahwilliams @goderbauer @tvolkert @Hixie @yjbanov @zanderso - I would not be surprised if this surfaces various breaking changes in tool/flutter/etc.

Activity

  1. added
    a: tests"flutter test", flutter_test, or one of our tests
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    toolAffects the "flutter" command-line tool. See also t: labels.
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Dec 17, 2019
  2. added this to the milestone on Dec 17, 2019
  3. goderbauer commented on Dec 17, 2019

    @goderbauer
    Member

    Have you tried running it with that a couple of times just for fun to see what would be breaking?

  4. zanderso commented on Dec 17, 2019

    @zanderso
    Member

    Could you clarify in the description what that flag gets passed to?

  5. dnfield commented on Dec 17, 2019

    @dnfield
    ContributorAuthor

    The flag is passed to package:test. We'll need to pipe it in for flutter test as well, but we could probably do it pretty easily with the tool tests.

    I haven't tried running it yet. I know for sure it would mess some things up on for Flutter until #47177 is merged.

  6. modified the milestones: , March 2020 on Dec 17, 2019
  7. dnfield commented on Mar 25, 2020

    @dnfield
    ContributorAuthor

    Bumping the milestone as this has turned into a large effort.

  8. Hixie commented on Mar 25, 2020

    @Hixie
    Contributor

    I recommend using the git hash as the seed, by the way, so that reproducing the failures is easy. Otherwise we're intentionally introducing randomness which will just manifest as flakiness.

  9. dnfield commented on Mar 25, 2020

    @dnfield
    ContributorAuthor

    The pr number might be safer since this has to be a 32 bit integer.

  10. Hixie commented on Mar 25, 2020

    @Hixie
    Contributor

    there might not be a PR (e.g. consider a local branch). Turning a git hash into a 32bit number is easy though, just chop off all but the first 32 bits. :-)

  11. added
    P1High-priority issues at the top of the work list
    on May 29, 2020
  12. removed their assignment
    on Dec 8, 2020
  13. removed this from the 1.26 - December 2020 milestone on Dec 8, 2020
  14. dnfield commented on Dec 8, 2020

    @dnfield
    ContributorAuthor

    Removing assignment and milestone for this. I came pretty close to landing this at one point, but it's a pretty tough moving target to hit, since new tess kept getting added that would break randomizability constraints.

    There are some ways that we should be able to do this - e.g. automatically detecting a flake related to randomization by rerunning without randomization if failure occurs, but I have some higher priority work at the moment and don't expect to be able to get to it soon.

  15. added
    P3Issues that are less important to the Flutter project
    and removed
    P1High-priority issues at the top of the work list
    on May 4, 2021
  16. added
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Jun 23, 2021
  17. self-assigned this
    on Jun 23, 2021
  18. github-actions commented on Aug 10, 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.

  19. locked as resolved and limited conversation to collaborators on Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsc: contributor-productivityTeam-specific productivity, code health, technical debt.frameworkflutter/packages/flutter repository. See also f: labels.toolAffects 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