Skip to content

Commit

Permalink
Add a multi_cpu_race helper
Browse files Browse the repository at this point in the history
This makes the test run alone, to increase the chance of a
multi-CPU race happening.
  • Loading branch information
Ian Lynagh committed Apr 17, 2013
1 parent 0b135e5 commit a4e32b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions driver/testlib.py
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions tests/rts/all.T
Expand Up @@ -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, [''] )

0 comments on commit a4e32b1

Please sign in to comment.