diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /test/tcl/lock001.tcl | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'test/tcl/lock001.tcl')
| -rw-r--r-- | test/tcl/lock001.tcl | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/tcl/lock001.tcl b/test/tcl/lock001.tcl index 71f54fd2..6fb43643 100644 --- a/test/tcl/lock001.tcl +++ b/test/tcl/lock001.tcl @@ -1,6 +1,6 @@ # See the file LICENSE for redistribution information. # -# Copyright (c) 1996, 2012 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2015 Oracle and/or its affiliates. All rights reserved. # # $Id$ # @@ -29,9 +29,10 @@ proc lock001 { {iterations 1000} } { # Open the region we'll use for testing. set eflags "-create -lock -home $testdir -mode 0644 \ - -lock_conflict {$nmodes {$conflicts}}" + -lock_conflict {$nmodes {$conflicts}} -mutex_set_incr 5000" set env [eval {berkdb_env} $eflags] error_check_good env [is_valid_env $env] TRUE + error_check_good lock_id_set \ [$env lock_id_set $lock_curid $lock_maxid] 0 @@ -106,9 +107,25 @@ proc lock001 { {iterations 1000} } { # Now release new locks release_list $locklist error_check_good free_id [$env lock_id_free $locker] 0 - error_check_good envclose [$env close] 0 + # Testing running out of lockers; it should no longer hang. + # Reopen env with _noerr so we can catch the error. + puts "\tLock001.f: Allocate all lockers; expecting a BDB2055 failure" + set env [eval {berkdb_env_noerr} $eflags] + set lastlocker -1; + set limit [expr $iterations + 6000] + for {set i 0} { $i < $limit } {incr i} { + if { [catch {$env lock_id} res] } { + error_check_match "Expecting to run out" \ + $res "*not enough memory" + break + } + set lastlocker $i + } + error_check_bad alloc_all_lockers $lastlocker $iterations + + error_check_good envclose [$env close] 0 } # Blocked locks appear as lockmgrN.lockM\nBLOCKED |
