Avoid using (clock seconds) in thread003.test. It is not available if testfixture is linked to tcl 8.5. (CVS 5634)
FossilOrigin-Name: b606263d0868aed267bcec623b9fe4d142099145
This commit is contained in:
+10
-11
@@ -12,7 +12,7 @@
|
||||
# This file contains tests that attempt to break the pcache module
|
||||
# by bombarding it with simultaneous requests from multiple threads.
|
||||
#
|
||||
# $Id: thread003.test,v 1.2 2008/08/28 10:21:17 danielk1977 Exp $
|
||||
# $Id: thread003.test,v 1.3 2008/08/28 13:55:10 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
|
||||
@@ -83,14 +83,13 @@ puts "Starting thread003.2 (should run for ~$nSecond seconds)"
|
||||
do_test thread003.2 {
|
||||
foreach zFile {test.db test2.db} {
|
||||
set SCRIPT [format {
|
||||
set iStart [clock seconds]
|
||||
set iEnd [expr {[clock seconds] + %d}]
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open %s]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
|
||||
while {[clock seconds] < $iEnd} {
|
||||
while {[clock_seconds] < $iEnd} {
|
||||
set iQuery [expr {int(rand()*5000)}]
|
||||
execsql " SELECT * FROM t1 WHERE a = $iQuery "
|
||||
}
|
||||
@@ -120,14 +119,14 @@ puts "Starting thread003.3 (should run for ~$nSecond seconds)"
|
||||
do_test thread003.3 {
|
||||
foreach zFile {test.db test2.db} {
|
||||
set SCRIPT [format {
|
||||
set iStart [clock seconds]
|
||||
set iEnd [expr {[clock seconds] + %d}]
|
||||
set iStart [clock_seconds]
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open %s]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
|
||||
while {[clock seconds] < $iEnd} {
|
||||
while {[clock_seconds] < $iEnd} {
|
||||
set iQuery [expr {int(rand()*5000)}]
|
||||
execsql "SELECT * FROM t1 WHERE a = $iQuery"
|
||||
execsql "UPDATE t1 SET b = randomblob(200)
|
||||
@@ -158,13 +157,13 @@ set nSecond 30
|
||||
puts "Starting thread003.3 (should run for ~$nSecond seconds)"
|
||||
do_test thread003.4 {
|
||||
thread_spawn finished(1) $thread_procs [format {
|
||||
set iEnd [expr {[clock seconds] + %d}]
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
set ::DB [sqlthread open test.db]
|
||||
|
||||
# Set the cache size to 15 pages per cache. 30 available globally.
|
||||
execsql { PRAGMA cache_size = 15 }
|
||||
|
||||
while {[clock seconds] < $iEnd} {
|
||||
while {[clock_seconds] < $iEnd} {
|
||||
set iQuery [expr {int(rand()*5000)}]
|
||||
execsql "SELECT * FROM t1 WHERE a = $iQuery"
|
||||
}
|
||||
@@ -173,9 +172,9 @@ do_test thread003.4 {
|
||||
expr 1
|
||||
} $nSecond]
|
||||
thread_spawn finished(2) [format {
|
||||
set iEnd [expr {[clock seconds] + %d}]
|
||||
set iEnd [expr {[clock_seconds] + %d}]
|
||||
|
||||
while {[clock seconds] < $iEnd} {
|
||||
while {[clock_seconds] < $iEnd} {
|
||||
sqlite3_release_memory 1000
|
||||
}
|
||||
} $nSecond]
|
||||
|
||||
Reference in New Issue
Block a user