System.Data.SQLite
Check-in [738abc1a0b]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Logging related enhancements to stress test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | threadAbortProtect
Files: files | file ages | folders
SHA1: 738abc1a0b3a80e27bd0851ce4f58520d4cd39ca
User & Date: mistachkin 2012-10-12 13:40:43
Context
2012-10-12
14:09
Enhance stress test workload diagnostic messages. check-in: 70c11fc93f user: mistachkin tags: threadAbortProtect
13:40
Logging related enhancements to stress test. check-in: 738abc1a0b user: mistachkin tags: threadAbortProtect
11:28
Enhance Thread.Abort protection and add a special test for it. Also, enhance the test suite infrastructure in support of this new test and fix comments in a related test file. check-in: 6f81afd900 user: mistachkin tags: threadAbortProtect
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/stress.eagle.

    18     18   package require System.Data.SQLite.Test
    19     19   runSQLiteTestPrologue
    20     20   
    21     21   ###############################################################################
    22     22   
    23     23   runTest {test stress-1.1 {multithreaded stress testing} -setup {
    24     24     unset -nocomplain result thread index workload noWorkload srcDb db \
    25         -      fileName compiled options count
           25  +      fileName compiled options count loggingLambda
    26     26   
    27     27     #############################################################################
    28     28   
    29     29     proc expectedError { error } {
    30     30       return [expr {[regexp -- {\sno such table: t1\s} $error] || \
    31     31           [regexp -- {\sdatabase is locked\s} $error]}]
    32     32     }
................................................................................
    44     44       set level [expr {[info level] - 1}]
    45     45   
    46     46       tputs $::test_channel [appendArgs \
    47     47           \n [info level $level] ": " $error \n]
    48     48   
    49     49       exit Failure; # halt all testing now.
    50     50     }
           51  +
           52  +  #############################################################################
           53  +
           54  +  proc setupLogging {} {
           55  +    if {[info exists ::loggingLambda]} then return
           56  +    set ::loggingLambda [list apply [list [list sender e] {
           57  +      tputs $::test_channel [appendArgs \
           58  +          "---- SQLiteLog.Log (" [$e ErrorCode] "): " [$e Message] \n]
           59  +    }]]
           60  +    object invoke System.Data.SQLite.SQLiteLog add_Log $::loggingLambda
           61  +    tputs $::test_channel "---- setupLogging: SQLite logging enabled.\n"
           62  +  }
           63  +
           64  +  #############################################################################
           65  +
           66  +  proc cleanupLogging {} {
           67  +    if {![info exists ::loggingLambda]} then return
           68  +    object invoke System.Data.SQLite.SQLiteLog remove_Log $::loggingLambda
           69  +    tputs $::test_channel "---- cleanupLogging: SQLite logging disabled.\n"
           70  +  }
           71  +
           72  +  #############################################################################
           73  +
           74  +  setupLogging
    51     75   
    52     76     #############################################################################
    53     77   
    54     78     set count(0) 1
    55     79     set count(1) 5
    56     80     set count(2) 300
    57     81     set noWorkload [list]
................................................................................
   634    658     foreach index(0) [array names workload] {
   635    659       catch {
   636    660         object removecallback [list apply $workload($index(0)) $fileName(1) \
   637    661             $fileName(2) t1 $count(1)]
   638    662       }
   639    663     }
   640    664   
          665  +  cleanupLogging
          666  +  catch {object removecallback $loggingLambda}
          667  +
          668  +  rename cleanupLogging ""
          669  +  rename setupLogging ""
          670  +
   641    671     unset -nocomplain result thread index workload noWorkload srcDb db \
   642         -      fileName compiled options count times
          672  +      fileName compiled options count times loggingLambda
   643    673   } -constraints \
   644    674   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result {}}
   645    675   
   646    676   ###############################################################################
   647    677   
   648    678   runSQLiteTestEpilogue
   649    679   runTestEpilogue