aboutsummaryrefslogtreecommitdiff
path: root/testdata/mptest/crash02.subtest
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2017-07-01 23:04:53 +0200
committerJan Mercl <0xjnml@gmail.com>2017-07-01 23:04:53 +0200
commit5e8a085cfb2f6df373a2a68436b1c1acacba592b (patch)
tree6cd0e355f252b4e45331b7e476904c9b588ddce5 /testdata/mptest/crash02.subtest
parent8370d1a12ed5bbad6630675316ee3985d8372a7b (diff)
Add a couple of tests. Build only on linux, do not pass.
modified: Makefile modified: all_test.go modified: generator.go modified: internal/bin/bin_linux_386.go modified: internal/bin/bin_linux_amd64.go new file: internal/mptest/mptest_linux_386.go new file: internal/mptest/mptest_linux_amd64.go new file: internal/threadtest1/threadtest1_linux_386.go new file: internal/threadtest1/threadtest1_linux_amd64.go new file: internal/threadtest2/threadtest2_linux_386.go new file: internal/threadtest2/threadtest2_linux_amd64.go new file: internal/threadtest4/threadtest4_linux_386.go new file: internal/threadtest4/threadtest4_linux_amd64.go modified: main.c new file: sqlite.h new file: testdata/mptest/config01.test new file: testdata/mptest/config02.test new file: testdata/mptest/crash01.test new file: testdata/mptest/crash02.subtest new file: testdata/mptest/multiwrite01.test
Diffstat (limited to 'testdata/mptest/crash02.subtest')
-rw-r--r--testdata/mptest/crash02.subtest53
1 files changed, 53 insertions, 0 deletions
diff --git a/testdata/mptest/crash02.subtest b/testdata/mptest/crash02.subtest
new file mode 100644
index 0000000..86f64dd
--- /dev/null
+++ b/testdata/mptest/crash02.subtest
@@ -0,0 +1,53 @@
+/*
+** This script is called from crash01.test and config02.test and perhaps other
+** script. After the database file has been set up, make a big rollback
+** journal in client 1, then crash client 1.
+** Then in the other clients, do an integrity check.
+*/
+--task 1 leave-hot-journal
+ --sleep 5
+ --finish
+ PRAGMA cache_size=10;
+ BEGIN;
+ UPDATE t1 SET b=randomblob(20000);
+ UPDATE t2 SET b=randomblob(20000);
+ UPDATE t3 SET b=randomblob(20000);
+ UPDATE t4 SET b=randomblob(20000);
+ UPDATE t5 SET b=randomblob(20000);
+ UPDATE t1 SET b=NULL;
+ UPDATE t2 SET b=NULL;
+ UPDATE t3 SET b=NULL;
+ UPDATE t4 SET b=NULL;
+ UPDATE t5 SET b=NULL;
+ --print Task one crashing an incomplete transaction
+ --exit 1
+--end
+--task 2 integrity_check-2
+ SELECT count(*) FROM t1;
+ --match 64
+ --sleep 100
+ PRAGMA integrity_check(10);
+ --match ok
+--end
+--task 3 integrity_check-3
+ SELECT count(*) FROM t1;
+ --match 64
+ --sleep 100
+ PRAGMA integrity_check(10);
+ --match ok
+--end
+--task 4 integrity_check-4
+ SELECT count(*) FROM t1;
+ --match 64
+ --sleep 100
+ PRAGMA integrity_check(10);
+ --match ok
+--end
+--task 5 integrity_check-5
+ SELECT count(*) FROM t1;
+ --match 64
+ --sleep 100
+ PRAGMA integrity_check(10);
+ --match ok
+--end
+--wait all