Skip to content

testing: add shuffle flag #10655

Closed
Closed

Description

@bradfitz

The testing package should have a -testing.shuffle boolean flag, to randomize the order of tests. This would help shake out accidental ordering assumptions. I'd enable this flag before doing stress testing of Go 1.5 on hundreds of VMs before the release.

Activity

  1. added this to the Go1.5Maybe milestone on May 1, 2015
  2. doktorbro commented on May 3, 2015

    @doktorbro

    This is great. I hope it lands in the next version.

  3. gopherbot commented on May 3, 2015

    @gopherbot
    Contributor

    CL https://golang.org/cl/9635 mentions this issue.

  4. bradfitz commented on May 3, 2015

    @bradfitz
    ContributorAuthor

    We'd also want to make any failures be reproducible later. That implies a PRNG, and printing the seed in test failures. So maybe -testing.shuffle should not be a custom flag type (boolean or seed value), or there should be a second flag to set the seed.

  5. jasdel commented on May 4, 2015

    @jasdel
    Contributor

    I'd suggest two flags, a boolean to shuffle with a default seed(time), and a flag which takes a seed as a parameter. When a test fails print out the seed used. I think this would work, because as a user I would only care about the seed if I needed to reproduce a failure case.

  6. doktorbro commented on May 4, 2015

    @doktorbro

    I like what @jasdel say.

    • shuffle (boolean)
    • seed (integer)
  7. josharian commented on May 4, 2015

    @josharian
    Contributor

    I'm not sure that we should shuffle benchmarks. Re-arranging benchmarks, particularly microbenchmarks, can result in apparent performance changes: #7920. Also, benchcmp assumes that benchmarks have a stable order. This helps get good results when benchmarks in different packages have the same name. It is also what makes the -best flag possible.

  8. modified the milestones: Go1.6, Go1.5Maybe on May 6, 2015
  9. rsc commented on Jun 26, 2015

    @rsc
    Contributor

    Marking Go1.6Early. I think there's a lot of design left here.

  10. modified the milestones: Go1.6Early, Go1.6 on Jun 26, 2015
  11. rsc commented on Nov 4, 2015

    @rsc
    Contributor

    The design did not happen, so not for Go 1.6. If someone is interested, please file a new proposal issue (golang.org/s/proposal). We'll probably need a design doc.

  12. locked and limited conversation to collaborators on Nov 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions