From 63fcce84ba5caa2a716e8167f0e499115fee1a54 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Mar 2011 23:04:04 +0100 Subject: [PATCH] go-test.exp: For goroutines.go test if GCCGO_RUN_ALL_TESTS is not set in the environment... * go.test/go-test.exp: For goroutines.go test if GCCGO_RUN_ALL_TESTS is not set in the environment, pass 64 as first argument when not running expensive tests or pass max($[`ulimit -u`/4], 10000) on native where ulimit -u is supported. From-SVN: r170792 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/go.test/go-test.exp | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4cecf2e8c9c..2b171dcd545 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-03-08 Jakub Jelinek + + * go.test/go-test.exp: For goroutines.go test if GCCGO_RUN_ALL_TESTS + is not set in the environment, pass 64 as first argument when not + running expensive tests or pass max($[`ulimit -u`/4], 10000) on + native where ulimit -u is supported. + 2011-03-08 Andreas Krebbel * gcc.dg/optimize-bswapsi-1.c: Use -march=z900 on s390. diff --git a/gcc/testsuite/go.test/go-test.exp b/gcc/testsuite/go.test/go-test.exp index 8945b0526ca..19cc0dfc4d3 100644 --- a/gcc/testsuite/go.test/go-test.exp +++ b/gcc/testsuite/go.test/go-test.exp @@ -265,6 +265,27 @@ proc go-gc-tests { } { verbose -log "$test: go_execute_args is $go_execute_args" set index [string last " $progargs" $test_line] set test_line [string replace $test_line $index end] + } elseif { [string match "*go.test/test/chan/goroutines.go" $test] \ + && [getenv GCCGO_RUN_ALL_TESTS] == "" } { + # goroutines.go spawns by default 10000 threads, which is too much + # for many OSes. + if { [getenv GCC_TEST_RUN_EXPENSIVE] == "" } { + set go_execute_args 64 + } elseif { ![is_remote host] && ![is_remote target] } { + # When using low ulimit -u limit, use maximum of + # a quarter of that limit and 10000 even when running expensive + # tests, otherwise parallel tests might fail after fork failures. + set nproc [lindex [remote_exec host {sh -c ulimit\ -u}] 1] + if { [string is integer -strict $nproc] } { + set nproc [expr $nproc / 4] + if { $nproc > 10000 } { set nproc 10000 } + if { $nproc < 16 } { set nproc 16 } + set go_execute_args $nproc + } + } + if { "$go_execute_args" != "" } { + verbose -log "$test: go_execute_args is $go_execute_args" + } } if { $test_line == "// \$G \$D/\$F\.go && \$L \$F\.\$A && \./\$A\.out >tmp.go &&" \ -- 2.30.2