mirror of https://github.com/golang/go.git
runtime: remove crash_cgo_test CgoRaceSignal timeout
The test had a 5 second timeout. Running the test on a Darwin system sometimes took less than 5 seconds but often took up to 8 seconds. We don't need a timeout anyhow. Instead, use testenv.Command to run the program, which uses the test timeout. Fixes #59807 Change-Id: Ibf3eda9702731bf98601782f4abd11c3caa0bf40 Reviewed-on: https://go-review.googlesource.com/c/go/+/494456 Run-TryBot: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
e2500be549
commit
a25688d406
|
|
@ -410,9 +410,6 @@ func TestRaceSignal(t *testing.T) {
|
||||||
t.Skipf("skipping: test requires pthread support")
|
t.Skipf("skipping: test requires pthread support")
|
||||||
// TODO: Can this test be rewritten to use the C11 thread API instead?
|
// TODO: Can this test be rewritten to use the C11 thread API instead?
|
||||||
}
|
}
|
||||||
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
|
|
||||||
testenv.SkipFlaky(t, 59807)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|
@ -429,7 +426,7 @@ func TestRaceSignal(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
got, err := testenv.CleanCmdEnv(exec.Command(exe, "CgoRaceSignal")).CombinedOutput()
|
got, err := testenv.CleanCmdEnv(testenv.Command(t, exe, "CgoRaceSignal")).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Logf("%s\n", got)
|
t.Logf("%s\n", got)
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,6 @@ import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
@ -90,14 +88,6 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CgoRaceSignal() {
|
func CgoRaceSignal() {
|
||||||
// The failure symptom is that the program hangs because of a
|
|
||||||
// deadlock in malloc, so set an alarm.
|
|
||||||
go func() {
|
|
||||||
time.Sleep(5 * time.Second)
|
|
||||||
fmt.Println("Hung for 5 seconds")
|
|
||||||
os.Exit(1)
|
|
||||||
}()
|
|
||||||
|
|
||||||
C.runRaceSignalThread()
|
C.runRaceSignalThread()
|
||||||
fmt.Println("OK")
|
fmt.Println("OK")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue