Skip to content

testing: the overview documentation on (*T) Run is unclear #35824

@ghost

Description

The package documentation says that

// Run does not return until parallel subtests have completed

But that means that in the example above (see below) the tests aren't run in parallel, because "Run does not return", which I take to mean that the first Run blocks (and then the second too, etc):

//     func TestGroupedParallel(t *testing.T) {
//         for _, tc := range tests {
//             tc := tc // capture range variable
//             t.Run(tc.Name, func(t *testing.T) {
//                 t.Parallel()
//                 ...
//             })
//         }
//     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions