crypto/tls: skip part of the test based on GOOS instead of GOARCH

This allows to skip the last part of the test under GopherJS as well as
WebAssembly, since GopherJS shares GOOS=js with wasm.

Change-Id: I41adad788043c1863b23eb2a6da9bc9aa2833092
GitHub-Last-Rev: d8d42a3b7ccb2bee6479306b6ac1a319443702ec
GitHub-Pull-Request: golang/go#51827
Reviewed-on: https://go-review.googlesource.com/c/go/+/394114
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Nevkontakte 2025-04-21 13:13:04 +00:00 committed by Gopher Robot
parent f1ebad19bd
commit 71d9505998
2 changed files with 4 additions and 4 deletions

View File

@ -2655,8 +2655,8 @@ func TestClientHandshakeContextCancellation(t *testing.T) {
if err != context.Canceled { if err != context.Canceled {
t.Errorf("Unexpected client handshake error: %v", err) t.Errorf("Unexpected client handshake error: %v", err)
} }
if runtime.GOARCH == "wasm" { if runtime.GOOS == "js" || runtime.GOOS == "wasip1" {
t.Skip("conn.Close does not error as expected when called multiple times on WASM") t.Skip("conn.Close does not error as expected when called multiple times on GOOS=js or GOOS=wasip1")
} }
err = cli.Close() err = cli.Close()
if err == nil { if err == nil {

View File

@ -2044,8 +2044,8 @@ func TestServerHandshakeContextCancellation(t *testing.T) {
if err != context.Canceled { if err != context.Canceled {
t.Errorf("Unexpected server handshake error: %v", err) t.Errorf("Unexpected server handshake error: %v", err)
} }
if runtime.GOARCH == "wasm" { if runtime.GOOS == "js" || runtime.GOOS == "wasip1" {
t.Skip("conn.Close does not error as expected when called multiple times on WASM") t.Skip("conn.Close does not error as expected when called multiple times on GOOS=js or GOOS=wasip1")
} }
err = conn.Close() err = conn.Close()
if err == nil { if err == nil {