diff options
Diffstat (limited to 'src/runtime/proc_test.go')
| -rw-r--r-- | src/runtime/proc_test.go | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index c0213086b3..30798f723d 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -329,48 +329,13 @@ func TestPreemptionGC(t *testing.T) { } func TestGCFairness(t *testing.T) { - output := executeTest(t, testGCFairnessSource, nil) + output := runTestProg(t, "testprog", "GCFairness") want := "OK\n" if output != want { t.Fatalf("want %s, got %s\n", want, output) } } -const testGCFairnessSource = ` -package main - -import ( - "fmt" - "os" - "runtime" - "time" -) - -func main() { - runtime.GOMAXPROCS(1) - f, err := os.Open("/dev/null") - if os.IsNotExist(err) { - // This test tests what it is intended to test only if writes are fast. - // If there is no /dev/null, we just don't execute the test. - fmt.Println("OK") - return - } - if err != nil { - fmt.Println(err) - os.Exit(1) - } - for i := 0; i < 2; i++ { - go func() { - for { - f.Write([]byte(".")) - } - }() - } - time.Sleep(10 * time.Millisecond) - fmt.Println("OK") -} -` - func TestPingPongHog(t *testing.T) { if testing.Short() { t.Skip("skipping in -short mode") |
