[commit: testsuite] master: Add a multi_cpu_race helper (a4e32b1)

Ian Lynagh igloo at earth.li
Wed Apr 17 23:01:09 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

https://github.com/ghc/testsuite/commit/a4e32b17439f3c305f6ff10fe194a6bf2624fd47

>---------------------------------------------------------------

commit a4e32b17439f3c305f6ff10fe194a6bf2624fd47
Author: Ian Lynagh <ian at well-typed.com>
Date:   Wed Apr 17 20:43:49 2013 +0100

    Add a multi_cpu_race helper
    
    This makes the test run alone, to increase the chance of a
    multi-CPU race happening.

>---------------------------------------------------------------

 driver/testlib.py |    5 +++++
 tests/rts/all.T   |    3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/driver/testlib.py b/driver/testlib.py
index cde55f3..d804e2f 100644
--- a/driver/testlib.py
+++ b/driver/testlib.py
@@ -387,6 +387,11 @@ def _namebase( opts, nb ):
 def high_memory_usage(name, opts):
     opts.alone = True
 
+# If a test is for a multi-CPU race, then running the test alone
+# increases the chance that we'll actually see it.
+def multi_cpu_race(name, opts):
+    opts.alone = True
+
 # ---
 def literate( name, opts ):
     opts.literate = 1;
diff --git a/tests/rts/all.T b/tests/rts/all.T
index f345b3b..a592d96 100644
--- a/tests/rts/all.T
+++ b/tests/rts/all.T
@@ -166,7 +166,6 @@ test('stablename001', expect_fail_for(['hpc']), compile_and_run, [''])
 # hpc should fail this, because it tags every variable occurrence with
 # a different tick.  It's probably a bug if it works, hence expect_fail.
 
-# Run this test alone (via, high_memory_usage) to increase chances of seeing the race.
-test('T7815', [ high_memory_usage,
+test('T7815', [ multi_cpu_race,
                 extra_run_opts('50000 +RTS -N2 -RTS'),
                 only_ways(['threaded1', 'threaded2']) ], compile_and_run, [''] )





More information about the ghc-commits mailing list