/ Check-in [84b0c2bc]
Login

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

Overview
Comment:Changes to exclusive2.test to make it more deterministic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 84b0c2bc7125623be2ee526b5ca75e1b72debb93
User & Date: dan 2011-01-26 06:13:15
Context
2011-01-26
07:25
Update mutex1.test so that it works with the memsubsys1 permutation (pagecache memory). Change a few instances of SQLITE_MUTEX_STATIC_LRU2 in comments and test code to STATIC_PMEM. check-in: 456bd5c6 user: dan tags: trunk
06:13
Changes to exclusive2.test to make it more deterministic. check-in: 84b0c2bc user: dan tags: trunk
00:07
Rename the PCache1.mxPinned field to n90pct (since it is 90% of nMax) in order to distinguish it from PGroup.mxPinned. Fix the computation of n90pct so that it does not overflow adversely on excessively large cache sizes. check-in: c85202ba user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/exclusive2.test.

   159    159   }
   160    160   do_test exclusive2-1.10 {
   161    161     pagerChangeCounter test.db 2
   162    162   } {2}
   163    163   do_test exclusive2-1.11 {
   164    164     expr {[t1sig] eq $::sig}
   165    165   } {0}
          166  +db2 close
   166    167   
   167    168   #--------------------------------------------------------------------
   168    169   # These tests - exclusive2-2.X - are similar to exclusive2-1.X, 
   169    170   # except that they are run with locking_mode=EXCLUSIVE.
   170    171   #
   171    172   # 1-3:   Build a database with exclusive-access connection 1, 
   172    173   #        calculate a signature.
................................................................................
   248    249   # These tests - exclusive2-3.X - verify that the pager change-counter
   249    250   # is only incremented by the first change when in exclusive access
   250    251   # mode. In normal mode, the change-counter is incremented once
   251    252   # per write-transaction.
   252    253   #
   253    254   
   254    255   db close
   255         -db2 close
   256    256   catch {close $::fd}
   257    257   file delete -force test.db
   258    258   file delete -force test.db-journal
   259    259   
   260    260   do_test exclusive2-3.0 {
   261    261     sqlite3 db test.db
   262    262     execsql {
   263    263       BEGIN;
   264    264       CREATE TABLE t1(a UNIQUE);
   265         -    INSERT INTO t1 VALUES(randstr(10, 400));
   266         -    INSERT INTO t1 VALUES(randstr(10, 400));
          265  +    INSERT INTO t1 VALUES(randstr(200, 200));
          266  +    INSERT INTO t1 VALUES(randstr(200, 200));
   267    267       COMMIT;
   268    268     }
   269    269     readPagerChangeCounter test.db
   270    270   } {1}
   271    271   do_test exclusive2-3.1 {
   272    272     execsql {
   273         -    INSERT INTO t1 VALUES(randstr(10, 400));
          273  +    INSERT INTO t1 VALUES(randstr(200, 200));
   274    274     }
   275    275     readPagerChangeCounter test.db
   276    276   } {2}
   277    277   do_test exclusive2-3.2 {
   278    278     execsql {
   279         -    INSERT INTO t1 VALUES(randstr(10, 400));
          279  +    INSERT INTO t1 VALUES(randstr(200, 200));
   280    280     }
   281    281     readPagerChangeCounter test.db
   282    282   } {3}
   283    283   do_test exclusive2-3.3 {
   284    284     execsql {
   285    285       PRAGMA locking_mode = exclusive;
   286         -    INSERT INTO t1 VALUES(randstr(10, 400));
          286  +    INSERT INTO t1 VALUES(randstr(200, 200));
   287    287     }
   288    288     readPagerChangeCounter test.db
   289    289   } {4}
   290    290   do_test exclusive2-3.4 {
          291  +breakpoint
   291    292     execsql {
   292         -    INSERT INTO t1 VALUES(randstr(10, 400));
          293  +    INSERT INTO t1 VALUES(randstr(200, 200));
   293    294     }
   294    295     readPagerChangeCounter test.db
   295    296   } {4}
   296    297   do_test exclusive2-3.5 {
   297    298     execsql {
   298    299       PRAGMA locking_mode = normal;
   299         -    INSERT INTO t1 VALUES(randstr(10, 400));
          300  +    INSERT INTO t1 VALUES(randstr(200, 200));
          301  +  }
          302  +  readPagerChangeCounter test.db
          303  +} {4}
          304  +do_test exclusive2-3.6 {
          305  +  execsql {
          306  +    INSERT INTO t1 VALUES(randstr(200, 200));
   300    307     }
   301    308     readPagerChangeCounter test.db
   302    309   } {5}
   303         -do_test exclusive2-3.6 {
   304         -  execsql {
   305         -    INSERT INTO t1 VALUES(randstr(10, 400));
   306         -  }
   307         -  readPagerChangeCounter test.db
   308         -} {6}
   309    310   sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
   310    311   
   311    312   finish_test