]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/runtime/crash_test.go
runtime: skip TestG0StackOverflow on windows/arm64
[gostls13.git] / src / runtime / crash_test.go
index 38ff6020965a1fb57620a882a1572ac4c8ba888b..ffd99f3a87b75a31851ce606a91610ef835618b6 100644 (file)
@@ -792,14 +792,29 @@ func TestRuntimePanic(t *testing.T) {
 func TestG0StackOverflow(t *testing.T) {
        testenv.MustHaveExec(t)
 
+       if runtime.GOOS == "ios" {
+               testenv.SkipFlaky(t, 62671)
+       }
+       if runtime.GOOS == "windows" && runtime.GOARCH == "arm64" {
+               testenv.SkipFlaky(t, 63938) // TODO(cherry): fix and unskip
+       }
+
        if os.Getenv("TEST_G0_STACK_OVERFLOW") != "1" {
-               cmd := testenv.CleanCmdEnv(exec.Command(os.Args[0], "-test.run=^TestG0StackOverflow$", "-test.v"))
+               cmd := testenv.CleanCmdEnv(testenv.Command(t, os.Args[0], "-test.run=^TestG0StackOverflow$", "-test.v"))
                cmd.Env = append(cmd.Env, "TEST_G0_STACK_OVERFLOW=1")
                out, err := cmd.CombinedOutput()
                // Don't check err since it's expected to crash.
                if n := strings.Count(string(out), "morestack on g0\n"); n != 1 {
                        t.Fatalf("%s\n(exit status %v)", out, err)
                }
+               if runtime.CrashStackImplemented {
+                       // check for a stack trace
+                       want := "runtime.stackOverflow"
+                       if n := strings.Count(string(out), want); n < 5 {
+                               t.Errorf("output does not contain %q at least 5 times:\n%s", want, out)
+                       }
+                       return // it's not a signal-style traceback
+               }
                // Check that it's a signal-style traceback.
                if runtime.GOOS != "windows" {
                        if want := "PC="; !strings.Contains(string(out), want) {