/ Check-in [fb09152d]
Login

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

Overview
Comment:Do not do the *-closeallfiles test for notify2.test. It uses multiple threads.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fb09152db879211986a7161a96a61da1425f79ef
User & Date: dan 2010-07-06 11:26:16
Context
2010-07-06
20:33
Modified the xWrite() method on Windows to differentiate between IO and disk full error returns. check-in: ca4b7ffb user: shaneh tags: trunk
11:26
Do not do the *-closeallfiles test for notify2.test. It uses multiple threads. check-in: fb09152d user: dan tags: trunk
10:55
Before calling Tcl_ExitThread() in a multi-threaded test, call Tcl_DoOneEvent() as many times as necessary to handle any queued events. check-in: b3399b40 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/permutations.test.

   117    117   
   118    118   #-------------------------------------------------------------------------
   119    119   # Define the generic test suites:
   120    120   #
   121    121   #   veryquick
   122    122   #   quick
   123    123   #   full
   124         -#   veryquick_plus_notify2
   125    124   #
   126    125   lappend ::testsuitelist xxx
   127    126   
   128    127   test_suite "veryquick" -prefix "" -description {
   129    128     "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
   130    129     This test suite is the same as the "quick" tests, except that some files
   131    130     that test malloc and IO errors are omitted.
................................................................................
   135    134   
   136    135   test_suite "quick" -prefix "" -description {
   137    136     Quick test suite. Runs in around 10 minutes on a workstation.
   138    137   } -files [
   139    138     test_set $allquicktests
   140    139   ]
   141    140   
   142         -test_suite "veryquick_plus_notify2" -prefix "" -description {
   143         -  Very quick test suite + file notify2.test. This is used by one of the 
   144         -  sqlite.org release test configurations.
   145         -} -files [ 
   146         -  test_set $allquicktests notify2.test -exclude *malloc* *ioerr* *fault*
   147         -]
   148         -
   149    141   test_suite "full" -prefix "" -description {
   150    142     Full test suite. Takes a long time.
   151    143   } -files [ 
   152    144     test_set $alltests 
   153    145   ] -initialize {
   154    146     unset -nocomplain ::G(isquick)
   155    147   }
          148  +
          149  +test_suite "threads" -prefix "" -description {
          150  +  All multi-threaded tests.
          151  +} -files {
          152  +  notify2.test   thread001.test thread002.test thread003.test 
          153  +  thread004.test thread005.test walthread.test
          154  +}
          155  +
   156    156   
   157    157   lappend ::testsuitelist xxx
   158    158   #-------------------------------------------------------------------------
   159    159   # Define the coverage related test suites:
   160    160   #
   161    161   #   coverage-wal
   162    162   #

Changes to test/tester.tcl.

  1157   1157     interp eval tinterp [list array set ::G [array get ::G]]
  1158   1158   
  1159   1159     # Load the various test interfaces implemented in C.
  1160   1160     load_testfixture_extensions tinterp
  1161   1161   
  1162   1162     # Run the test script.
  1163   1163     interp eval tinterp $script
         1164  +
         1165  +  # Check if the interpreter call [run_thread_tests]
         1166  +  if { [interp eval tinterp {info exists ::run_thread_tests_called}] } {
         1167  +    set ::run_thread_tests_called 1
         1168  +  }
  1164   1169   
  1165   1170     # Delete the interpreter used to run the test script.
  1166   1171     interp delete tinterp
  1167   1172   }
  1168   1173   
  1169   1174   proc slave_test_file {zFile} {
  1170   1175     set tail [file tail $zFile]
................................................................................
  1172   1177     # Remember the value of the shared-cache setting. So that it is possible
  1173   1178     # to check afterwards that it was not modified by the test script.
  1174   1179     #
  1175   1180     ifcapable shared_cache { set scs [sqlite3_enable_shared_cache] }
  1176   1181   
  1177   1182     # Run the test script in a slave interpreter.
  1178   1183     #
         1184  +  unset -nocomplain ::run_thread_tests_called
  1179   1185     reset_prng_state
  1180   1186     set ::sqlite_open_file_count 0
  1181   1187     set time [time { slave_test_script [list source $zFile] }]
  1182   1188     set ms [expr [lindex $time 0] / 1000]
  1183   1189   
  1184   1190     # Test that all files opened by the test script were closed. Omit this
  1185   1191     # if the test script has "thread" in its name. The open file counter
  1186   1192     # is not thread-safe.
  1187   1193     #
  1188         -  if {[string match *thread* $tail]==0} {
         1194  +  if {[info exists ::run_thread_tests_called]==0} {
  1189   1195       do_test ${tail}-closeallfiles { expr {$::sqlite_open_file_count>0} } {0}
  1190   1196     }
  1191   1197     set ::sqlite_open_file_count 0
  1192   1198   
  1193   1199     # Test that the global "shared-cache" setting was not altered by 
  1194   1200     # the test script.
  1195   1201     #

Changes to test/thread_common.tcl.

    92     92     if {[info commands sqlthread] eq ""} {
    93     93       set zProblem "SQLite build is not threadsafe"
    94     94     }
    95     95     if {![info exists ::tcl_platform(threaded)]} {
    96     96       set zProblem "Linked against a non-threadsafe Tcl build"
    97     97     }
    98     98     if {[info exists zProblem]} {
    99         -    if {$print_warning} {
   100         -      if {[info exists ::run_thread_tests_failed]} {
   101         -        puts "WARNING: Multi-threaded tests skipped: $zProblem"
   102         -      }
   103         -    } else {
   104         -      puts "Skipping thread tests: $zProblem"
   105         -      set ::run_thread_tests_failed 1
   106         -    }
           99  +    puts "WARNING: Multi-threaded tests skipped: $zProblem"
   107    100       return 0
   108    101     }
          102  +  set ::run_thread_tests_called 1
   109    103     return 1;
   110    104   }
   111    105   
   112    106   return 0
   113    107