CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
103 lines
2.3 KiB
Plaintext
103 lines
2.3 KiB
Plaintext
# 2005 October 3
|
|
#
|
|
# The author disclaims copyright to this source code. In place of
|
|
# a legal notice, here is a blessing:
|
|
#
|
|
# May you do good and not evil.
|
|
# May you find forgiveness for yourself and forgive others.
|
|
# May you share freely, never taking more than you give.
|
|
#
|
|
#***********************************************************************
|
|
# This file implements regression tests for SQLite library.
|
|
#
|
|
# This file implements tests the ability of the library to open
|
|
# many different databases at the same time without leaking memory.
|
|
#
|
|
# $Id: manydb.test,v 1.4 2008/11/21 00:10:35 aswift Exp $
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
set N 300
|
|
# if we're using proxy locks, we use 5 filedescriptors for a db
|
|
# that is open and in the middle of writing changes, normally
|
|
# sqlite uses 3 (proxy locking adds the conch and the local lock)
|
|
set using_proxy 0
|
|
foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] {
|
|
set using_proxy value
|
|
}
|
|
set num_fd_per_openwrite_db 3
|
|
if {$using_proxy>0} {
|
|
set num_fd_per_openwrite_db 5
|
|
}
|
|
|
|
# First test how many file descriptors are available for use. To open a
|
|
# database for writing SQLite requires 3 file descriptors (the database, the
|
|
# journal and the directory).
|
|
set filehandles {}
|
|
catch {
|
|
for {set i 0} {$i<($N * 3)} {incr i} {
|
|
lappend filehandles [open testfile.1 w]
|
|
}
|
|
}
|
|
foreach fd $filehandles {
|
|
close $fd
|
|
}
|
|
catch {
|
|
forcedelete testfile.1
|
|
}
|
|
set N [expr $i / $num_fd_per_openwrite_db]
|
|
|
|
# Create a bunch of random database names
|
|
#
|
|
unset -nocomplain dbname
|
|
unset -nocomplain used
|
|
for {set i 0} {$i<$N} {incr i} {
|
|
while 1 {
|
|
set name test-[format %08x [expr {int(rand()*0x7fffffff)}]].db
|
|
if {[info exists used($name)]} continue
|
|
set dbname($i) $name
|
|
set used($name) $i
|
|
break
|
|
}
|
|
}
|
|
|
|
# Create a bunch of databases
|
|
#
|
|
for {set i 0} {$i<$N} {incr i} {
|
|
do_test manydb-1.$i {
|
|
sqlite3 db$i $dbname($i)
|
|
execsql {
|
|
CREATE TABLE t1(a,b);
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES(1,2);
|
|
} db$i
|
|
} {}
|
|
}
|
|
|
|
# Finish the transactions
|
|
#
|
|
for {set i 0} {$i<$N} {incr i} {
|
|
do_test manydb-2.$i {
|
|
execsql {
|
|
COMMIT;
|
|
SELECT * FROM t1;
|
|
} db$i
|
|
} {1 2}
|
|
}
|
|
|
|
|
|
# Close the databases and erase the files.
|
|
#
|
|
for {set i 0} {$i<$N} {incr i} {
|
|
do_test manydb-3.$i {
|
|
db$i close
|
|
forcedelete $dbname($i)
|
|
} {}
|
|
}
|
|
|
|
|
|
|
|
|
|
finish_test
|