diff options
| author | Ian Lance Taylor <iant@golang.org> | 2022-01-18 18:46:00 -0800 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2022-01-20 19:24:26 +0000 |
| commit | 2c2e08144f79d8746384c2a483bf03532dc0c443 (patch) | |
| tree | 03d6c6174cb84db7f94cc1fa1fb98c7f173f9e10 /src/runtime/crash_cgo_test.go | |
| parent | 65535bfe6dad2cb7535f6a5647b288e4489608f9 (diff) | |
| download | go-2c2e08144f79d8746384c2a483bf03532dc0c443.tar.xz | |
runtime: remove -tags=threadprof in tests
Use an enviroment variable rather than a build tag to control starting
a busy loop thread when testprogcgo starts. This lets us skip another
build that invokes the C compiler and linker, which should avoid
timeouts running the runtime tests.
Fixes #44422
Change-Id: I516668d71a373da311d844990236566ff63e6d72
Reviewed-on: https://go-review.googlesource.com/c/go/+/379294
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/crash_cgo_test.go')
| -rw-r--r-- | src/runtime/crash_cgo_test.go | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index 6f1265c014..9444554d37 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -7,7 +7,6 @@ package runtime_test import ( - "bytes" "fmt" "internal/testenv" "os" @@ -95,17 +94,8 @@ func TestCgoExternalThreadSIGPROF(t *testing.T) { t.Skipf("no pthreads on %s", runtime.GOOS) } - exe, err := buildTestProg(t, "testprogcgo", "-tags=threadprof") - if err != nil { - t.Fatal(err) - } - - got, err := testenv.CleanCmdEnv(exec.Command(exe, "CgoExternalThreadSIGPROF")).CombinedOutput() - if err != nil { - t.Fatalf("exit status: %v\n%s", err, got) - } - - if want := "OK\n"; string(got) != want { + got := runTestProg(t, "testprogcgo", "CgoExternalThreadSIGPROF", "GO_START_SIGPROF_THREAD=1") + if want := "OK\n"; got != want { t.Fatalf("expected %q, but got:\n%s", want, got) } } @@ -118,18 +108,8 @@ func TestCgoExternalThreadSignal(t *testing.T) { t.Skipf("no pthreads on %s", runtime.GOOS) } - exe, err := buildTestProg(t, "testprogcgo", "-tags=threadprof") - if err != nil { - t.Fatal(err) - } - - got, err := testenv.CleanCmdEnv(exec.Command(exe, "CgoExternalThreadSignal")).CombinedOutput() - if err != nil { - t.Fatalf("exit status: %v\n%s", err, got) - } - - want := []byte("OK\n") - if !bytes.Equal(got, want) { + got := runTestProg(t, "testprogcgo", "CgoExternalThreadSignal") + if want := "OK\n"; got != want { t.Fatalf("expected %q, but got:\n%s", want, got) } } |
