diff options
author | sivchari <shibuuuu5@gmail.com> | 2024-02-26 15:08:13 +0900 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-03-21 20:26:36 +0000 |
commit | 5d29578fd54d5774ff0ecbe2b1407317bf64ead8 (patch) | |
tree | 5219ff217cbf66582cc27f07f7053fc8d81de58e /doc | |
parent | 0ae8468b204e454314c0f35411b15dc03c89ad30 (diff) | |
download | go-5d29578fd54d5774ff0ecbe2b1407317bf64ead8.tar.gz go-5d29578fd54d5774ff0ecbe2b1407317bf64ead8.zip |
testing: add TB.SetGOMAXPROCS function
Add a new method TB.SetGOMAXPROCS which sets variable of GOMAXPROCS.
This method aims to set a variable for the isolated lifetime of the test and cleans up.
And unset this when the test ends.
This method disables the test or benchmark from running in
parallel.
Fixes: #62020
Change-Id: Iae44109d0def35cc47049c3ca4cd5306173d52ee
Signed-off-by: sivchari <shibuuuu5@gmail.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/519235
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/next/6-stdlib/99-minor/testing/62020.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/next/6-stdlib/99-minor/testing/62020.md b/doc/next/6-stdlib/99-minor/testing/62020.md new file mode 100644 index 0000000000..3a73a1d8d6 --- /dev/null +++ b/doc/next/6-stdlib/99-minor/testing/62020.md @@ -0,0 +1 @@ +The [`SetGOMAXPROCS`](/pkg/testing#T.SetGOMAXPROCS) method changes GOMAXPROCS for the duration of a single test. |