diff options
author | tim@threads.polyesthetic.msg <> | 2001-03-04 19:42:05 -0500 |
---|---|---|
committer | tim@threads.polyesthetic.msg <> | 2001-03-04 19:42:05 -0500 |
commit | 89dad52004ecba5a380aeebb0e2a9beaae88eb86 (patch) | |
tree | 9dd732e08dba156ee3d7635caedc0dc3107ecac6 /bdb/test/lock003.tcl | |
parent | 639a1069d313843288ba6d9cb54b290073a748a7 (diff) | |
download | mariadb-git-89dad52004ecba5a380aeebb0e2a9beaae88eb86.tar.gz |
Import changeset
Diffstat (limited to 'bdb/test/lock003.tcl')
-rw-r--r-- | bdb/test/lock003.tcl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/bdb/test/lock003.tcl b/bdb/test/lock003.tcl new file mode 100644 index 00000000000..539b6d0ff66 --- /dev/null +++ b/bdb/test/lock003.tcl @@ -0,0 +1,48 @@ +# See the file LICENSE for redistribution information. +# +# Copyright (c) 1996, 1997, 1998, 1999, 2000 +# Sleepycat Software. All rights reserved. +# +# $Id: lock003.tcl,v 11.16 2000/08/25 14:21:51 sue Exp $ +# +# Exercise multi-process aspects of lock. Generate a bunch of parallel +# testers that try to randomly obtain locks. +proc lock003 { dir {iter 500} {max 1000} {procs 5} {ldegree 5} {objs 75} \ + {reads 65} {wait 1} {conflicts { 3 0 0 0 0 0 1 0 1 1}} {seeds {}} } { + source ./include.tcl + + puts "Lock003: Multi-process random lock test" + + # Clean up after previous runs + env_cleanup $dir + + # Open/create the lock region + set e [berkdb env -create -lock -home $dir] + error_check_good env_open [is_substr $e env] 1 + + set ret [$e close] + error_check_good env_close $ret 0 + + # Now spawn off processes + set pidlist {} + for { set i 0 } {$i < $procs} {incr i} { + if { [llength $seeds] == $procs } { + set s [lindex $seeds $i] + } + puts "$tclsh_path\ + $test_path/wrap.tcl \ + lockscript.tcl $dir/$i.lockout\ + $dir $iter $objs $wait $ldegree $reads &" + set p [exec $tclsh_path $test_path/wrap.tcl \ + lockscript.tcl $testdir/lock003.$i.out \ + $dir $iter $objs $wait $ldegree $reads &] + lappend pidlist $p + } + + puts "Lock003: $procs independent processes now running" + watch_procs 30 10800 + # Remove log files + for { set i 0 } {$i < $procs} {incr i} { + fileremove -f $dir/$i.lockout + } +} |