Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading documentation on test.parallel #83

Open
c-kruse opened this issue Feb 27, 2024 · 0 comments
Open

Misleading documentation on test.parallel #83

c-kruse opened this issue Feb 27, 2024 · 0 comments
Assignees

Comments

@c-kruse
Copy link

c-kruse commented Feb 27, 2024

The parallel parameter is currently described here as setting the go test -parallel flag, but it is instead setting the -p flag here - which is confusingly an entirely different setting that does not control the number of parallel tests within a package (t.Parallel), but the number of distinct test binaries that can be ran in parallel.

Allow parallel execution of test functions that call t.Parallel. The value of this flag is the maximum number of tests to run simultaneously

Relevant excerpt from go help testflag

        -parallel n
            Allow parallel execution of test functions that call t.Parallel,
            ...
            By default, -parallel is set to the value of GOMAXPROCS.
            ...
            Note that -parallel only applies within a single test binary.
            The 'go test' command may run tests for different packages
            in parallel as well, according to the setting of the -p flag
            (see 'go help build').

And for go help build

        -p n
                the number of programs, such as build commands or
                test binaries, that can be run in parallel.
                The default is GOMAXPROCS, normally the number of CPUs available.

I'm not sure what the right move here is for this project, but IHMO -p 1 is an inappropriate default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants