1
# See the file LICENSE for redistribution information.
3
# Copyright (c) 1996-2001
4
# Sleepycat Software. All rights reserved.
6
# $Id: dead001.tcl,v 11.19 2001/05/17 20:37:04 bostic Exp $
9
# We create various deadlock scenarios for different numbers of lockers
10
# and see if we can get the world cleaned up suitably.
11
proc dead001 { { procs "2 4 10" } {tests "ring clump" } } {
14
puts "Dead001: Deadlock detector tests"
18
# Create the environment.
19
puts "\tDead001.a: creating environment"
20
set env [berkdb env -create -mode 0644 -lock -home $testdir]
21
error_check_good lock_env:open [is_valid_env $env] TRUE
23
error_check_good lock_env:close [$env close] 0
25
set dpid [exec $util_path/db_deadlock -vw -h $testdir \
35
puts "\tDead001: $n procs of test $t"
36
for { set i 0 } { $i < $n } { incr i } {
37
puts "$tclsh_path $test_path/wrap.tcl \
38
$testdir/dead001.log.$i \
39
ddscript.tcl $testdir $t $i $i $n"
40
set p [exec $tclsh_path \
42
ddscript.tcl $testdir/dead001.log.$i \
43
$testdir $t $i $i $n &]
52
for { set i 0 } { $i < $n } { incr i } {
53
set did [open $testdir/dead001.log.$i]
54
while { [gets $did val] != -1 } {
56
DEADLOCK { incr dead }
58
default { incr other }
64
dead_check $t $n $dead $clean $other
69
# Windows needs files closed before deleting files, so pause a little
71
fileremove -f $testdir/dd.out
73
for { set i 0 } { $i < $n } { incr i } {
74
fileremove -f $testdir/dead001.log.$i