1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Updates to new test cases to run with SQLITE_ENABLE_SETLK_TIMEOUT=2 builds.

FossilOrigin-Name: c6d3e3542fdf6a3428d3a2ec20c699c169ed53341dc782d81f7fe5944f769748
This commit is contained in:
dan
2025-06-02 18:09:46 +00:00
parent eb9a145711
commit cfee69fbe4
4 changed files with 43 additions and 14 deletions

View File

@ -18,7 +18,7 @@ source $testdir/lock_common.tcl
set testprefix walsetlk_recover
ifcapable !wal {finish_test ; return }
ifcapable !setlk_timeout {finish_test ; return }
# ifcapable !setlk_timeout {finish_test ; return }
do_execsql_test 1.0 {
PRAGMA journal_mode = wal;
@ -69,7 +69,7 @@ proc sleep_callback {args} {
}
sqlite3 db test.db -vfs tvfs
sqlite3_setlk_timeout db 500
db timeout 500
set tm [lindex [time {
catch {
db eval {SELECT * FROM t1}
@ -88,9 +88,17 @@ do_execsql_test 1.4 {
db close
tvfs delete
do_test 1.5 {
set ::sleep_count
} 0
# All SQLite builds should pass the tests above. SQLITE_ENABLE_SETLK_TIMEOUT=1
# builds do so without calling the VFS xSleep method.
if {$::sqlite_options(setlk_timeout)==1} {
do_test 1.5.1 {
set ::sleep_count
} 0
} else {
do_test 1.5.2 {
expr $::sleep_count>0
} 1
}
finish_test

View File

@ -18,9 +18,18 @@ source $testdir/lock_common.tcl
set testprefix walsetlk_snapshot
ifcapable !wal {finish_test ; return }
ifcapable !setlk_timeout {finish_test ; return }
ifcapable !snapshot {finish_test; return}
db close
testvfs tvfs -fullshm 1
sqlite3 db test.db -vfs tvfs
tvfs script sleep_callback
tvfs filter xSleep
set ::sleep_count 0
proc sleep_callback {args} {
incr ::sleep_count
}
do_execsql_test 1.0 {
PRAGMA journal_mode = wal;
CREATE TABLE t1(a, b);
@ -84,5 +93,17 @@ sqlite3_snapshot_free $::snap
vwait myvar
# All SQLite builds should pass the tests above. SQLITE_ENABLE_SETLK_TIMEOUT=1
# builds do so without calling the VFS xSleep method.
if {$::sqlite_options(setlk_timeout)==1} {
do_test 1.5.1 {
set ::sleep_count
} 0
} else {
do_test 1.5.2 {
expr $::sleep_count>0
} 1
}
finish_test