Artifact e5a0cea07e62e4fc6e2162f9871d8e531083ce8d:

  • File test/lsm6.test — part of check-in [723d5f2f52] at 2013-02-20 17:54:41 on branch read-only-clients — Add a test to verify that an lsm_close() that disconnects the last connection to a database flushes the in-memory tree regardless of the multi-process or use-log settings. (user: dan size: 1129) [more...]

# 2013 February 20
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
#
# The focus of this file is testing the LSM library. Specifically, it
# checks that the in-memory tree is flushed to disk when the last connection
# is closed.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/lsm_common.tcl
set testprefix lsm6
db close

foreach {tn mp lf} {
         1  1  1
         2  1  0
         3  0  1
         4  0  0
} {

  do_test $tn.1 {
    forcedelete test.db test.db-log
    lsm_open db test.db [list multi_proc $mp use_log $lf]
    for {set i 0} {$i < 1000} {incr i} {
      db write $i [string repeat "$i." 1000]
    }
    expr {[file size test.db-log] > 0}
  } $lf

  do_test $tn.2 {
    db close
    lsm_open db test.db 
    db_fetch db 999
  } [string repeat 999. 1000]

  db close
}

finish_test