System.Data.SQLite
Check-in [b4c8f6a38d]
Not logged in

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

Overview
Comment:Even more enhancements to the stress test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b4c8f6a38d557681965b33f582e8bd67c6d48243
User & Date: mistachkin 2018-01-04 18:35:54
Context
2018-01-04
19:03
Stress test variable cleanup tweak. check-in: a7962f9e97 user: mistachkin tags: trunk
18:35
Even more enhancements to the stress test. check-in: b4c8f6a38d user: mistachkin tags: trunk
18:21
Further enhancements to the stress test. check-in: 752a5d8f13 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/stress.eagle.

108
109
110
111
112
113
114










115
116
117
118
119
120
121
...
379
380
381
382
383
384
385
386
387

388
389
390
391
392
393
394
...
409
410
411
412
413
414
415
416


417
418
419
420
421
422
423
...
429
430
431
432
433
434
435

436
437
438
439
440
441
442
...
572
573
574
575
576
577
578





579
580
581
582
583
584
585
...
807
808
809
810
811
812
813

814
815
816
817
818
819
820
...
842
843
844
845
846
847
848

849
850
851
852
853
854
855
...
877
878
879
880
881
882
883

884
885
886
887
888
889
890
...
912
913
914
915
916
917
918

919
920
921
922
923
924
925
...
946
947
948
949
950
951
952

953
954
955
956
957
958
959
...
980
981
982
983
984
985
986

987
988
989
990
991
992
993
....
1423
1424
1425
1426
1427
1428
1429

1430
1431
1432
1433
1434
1435
1436
....
1585
1586
1587
1588
1589
1590
1591

1592
1593
1594
1595
1596
1597
1598
....
1775
1776
1777
1778
1779
1780
1781

1782
1783
1784
1785
1786
1787
1788
....
1810
1811
1812
1813
1814
1815
1816
1817

1818
1819
1820
1821
1822
1823
1824
    if {[string length $sql] > 0} then {
      sql execute $db $sql
    }
  }

  #############################################################################











  proc formatWorkloadResult { index } {
    set result [appendArgs "---- iterations for workload (" $index "): "]

    append result [expr {[info exists ::iterations($index,total)] ? \
        $::iterations($index,total) : 0}] " total, "

    append result [expr {[info exists ::iterations($index,ok)] ? \
................................................................................
  set journalMode "";      # Initial journal mode for database files.
  set pageSize "";         # Initial page size for database files.
  set noWorkload [list];   # Workloads to be omitted from the run, by index.
  set priorities [list];   # Dictionary of workload thread priorities.
  set exitOnFail false;    # Halt testing and exit process on test failure?
  set coTaskMem true;      # Use AllocCoTaskMem/FreeCoTaskMem for memory?
  set noTrace false;       # Disable SQLite trace logging to a file?
  set beginTransaction ""; # SQL to execute before modifying the database.
  set endTransaction "";   # SQL to execute after modifying the database.


  #############################################################################

  #
  # NOTE: If command line arguments to the test suite are available, process
  #       them for any options that are applicable to this test (i.e. any of
  #       the tunable workload parameters listed above).
................................................................................
        [list null MustHaveIntegerValue -1 -1 -pageSize $pageSize] \
        [list null MustHaveListValue -1 -1 -noWorkload $noWorkload] \
        [list null MustHaveListValue -1 -1 -priorities $priorities] \
        [list null MustHaveBooleanValue -1 -1 -exitOnFail $exitOnFail] \
        [list null MustHaveBooleanValue -1 -1 -coTaskMem $coTaskMem] \
        [list null MustHaveBooleanValue -1 -1 -noTrace $noTrace] \
        [list null MustHaveValue -1 -1 -beginTransaction $beginTransaction] \
        [list null MustHaveValue -1 -1 -endTransaction $endTransaction]] $argv



    set count(0) $options(-count0,value)
    set count(1) $options(-count1,value)
    set count(2) $options(-count2,value)
    set count(3) $options(-count3,value)
    set count(4) $options(-count4,value)
    set count(5) $options(-count5,value)
................................................................................
    set noWorkload $options(-noWorkload,value)
    set priorities $options(-priorities,value)
    set exitOnFail $options(-exitOnFail,value)
    set coTaskMem $options(-coTaskMem,value)
    set noTrace $options(-noTrace,value)
    set beginTransaction $options(-beginTransaction,value)
    set endTransaction $options(-endTransaction,value)

  }

  #############################################################################

  #
  # NOTE: Load custom per-user and/or per-host test settings.  Currently, this
  #       is done after processing the command line options.  The settings file
................................................................................
      [appendArgs \" $beginTransaction \"] : "none"}] \n]

  tputs $test_channel [appendArgs \
      "---- end transaction SQL is " \
      [expr {[string length $endTransaction] > 0 ? \
      [appendArgs \" $endTransaction \"] : "none"}] \n]






  #############################################################################

  #
  # NOTE: Create the workload priority array based on the priority list seen
  #       on the command line, if any.
  #
  array set priority $priorities
................................................................................
          sql execute $db [appendArgs "INSERT INTO " $table \
              "(x, y, z) VALUES('" [format %lX [expr {random()}]] \
              "', '" [base64 encode -- [expr {randstr($count2)}]] \
              "', 'small');"]
          endTransaction $db
          showTest E
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest e
          } else {
            failTest e $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "INSERT INTO " $table \
              "(x, y, z) VALUES('" [format %lX [expr {random()}]] \
              "', RANDOMBLOB(" $count3 "), 'big');"]
          endTransaction $db
          showTest F
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest f
          } else {
            failTest f $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "UPDATE " $table \
              " SET y = '" [base64 encode -- [expr {randstr($count2)}]] \
              "' WHERE x LIKE '" [format %X $index] "%' AND z = 'small';"]
          endTransaction $db
          showTest G
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest g
          } else {
            failTest g $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "UPDATE " $table \
              " SET y = RANDOMBLOB(" $count3 ") WHERE x LIKE '" \
              [format %X $index] "%' AND z = 'big';"]
          endTransaction $db
          showTest H
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest h
          } else {
            failTest h $error
          }
        }
      }
................................................................................
        if {[catch {
          beginTransaction $db
          sql execute $db [appendArgs "DELETE FROM " $table \
              " WHERE x LIKE '" [format %X $index] "%' AND z = 'small';"]
          endTransaction $db
          showTest I
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest i
          } else {
            failTest i $error
          }
        }
      }
................................................................................
        if {[catch {
          beginTransaction $db
          sql execute $db [appendArgs "DELETE FROM " $table \
              " WHERE x LIKE '" [format %X $index] "%' AND z = 'big';"]
          endTransaction $db
          showTest J
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest j
          } else {
            failTest j $error
          }
        }
      }
................................................................................
          set result [sql execute -execute scalar $db \
              "PRAGMA integrity_check;"]
          if {$result ne "ok"} then {
            error [appendArgs "integrity check failed: " $result]
          }
          showTest R
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest r
          } else {
            failTest r $error
          }
        }
      }
................................................................................
              ") FROM s; WITH s(i) AS " \
              "(SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<" \
              $count5 ") INSERT INTO t3 SELECT RANDOMBLOB(" $count3 \
              ") FROM s; DELETE FROM t3;"]
          endTransaction $db
          showTest W
        } error]} then {

          if {[isExpectedError $error]} then {
            showTest w
          } else {
            failTest w $error
          }
        }
      }
................................................................................
  rename showTest ""
  rename waitTest ""
  rename delayTest ""
  rename initTest ""
  rename isExpectedError ""
  rename formatWorkloadTime ""
  rename formatWorkloadResult ""

  rename endTransaction ""
  rename beginTransaction ""
  rename setupWorkloadFileDb ""
  rename setupWorkloadMemDb ""

  catch {
    #
................................................................................
  rename cleanupLogging ""
  rename setupLogging ""

  unset -nocomplain result thread index workload priority journalMode \
      pageSize noWorkload priorities srcDb db fileName compiled options \
      count times logFileName logListener event timeout connection \
      indicators iterations exitOnFail coTaskMem noTrace beginTransaction \
      endTransaction failures status workloadNames workloadCallbacks

} -time true -constraints {eagle command.object monoBug40 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -result {0}}

###############################################################################

#
# NOTE: Report after test.







>
>
>
>
>
>
>
>
>
>







 







|
|
>







 







|
>
>







 







>







 







>
>
>
>
>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







>







 







|
>







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
...
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
...
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
...
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
...
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
...
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
...
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
...
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
...
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
...
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
....
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
....
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
....
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
....
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
....
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
    if {[string length $sql] > 0} then {
      sql execute $db $sql
    }
  }

  #############################################################################

  proc errorTransaction { db } {
    set sql $::errorTransaction

    if {[string length $sql] > 0} then {
      sql execute $db $sql
    }
  }

  #############################################################################

  proc formatWorkloadResult { index } {
    set result [appendArgs "---- iterations for workload (" $index "): "]

    append result [expr {[info exists ::iterations($index,total)] ? \
        $::iterations($index,total) : 0}] " total, "

    append result [expr {[info exists ::iterations($index,ok)] ? \
................................................................................
  set journalMode "";      # Initial journal mode for database files.
  set pageSize "";         # Initial page size for database files.
  set noWorkload [list];   # Workloads to be omitted from the run, by index.
  set priorities [list];   # Dictionary of workload thread priorities.
  set exitOnFail false;    # Halt testing and exit process on test failure?
  set coTaskMem true;      # Use AllocCoTaskMem/FreeCoTaskMem for memory?
  set noTrace false;       # Disable SQLite trace logging to a file?
  set beginTransaction ""; # SQL just before modifying the database.
  set endTransaction "";   # SQL just after modifying the database.
  set errorTransaction ""; # SQL just after a database modification error.

  #############################################################################

  #
  # NOTE: If command line arguments to the test suite are available, process
  #       them for any options that are applicable to this test (i.e. any of
  #       the tunable workload parameters listed above).
................................................................................
        [list null MustHaveIntegerValue -1 -1 -pageSize $pageSize] \
        [list null MustHaveListValue -1 -1 -noWorkload $noWorkload] \
        [list null MustHaveListValue -1 -1 -priorities $priorities] \
        [list null MustHaveBooleanValue -1 -1 -exitOnFail $exitOnFail] \
        [list null MustHaveBooleanValue -1 -1 -coTaskMem $coTaskMem] \
        [list null MustHaveBooleanValue -1 -1 -noTrace $noTrace] \
        [list null MustHaveValue -1 -1 -beginTransaction $beginTransaction] \
        [list null MustHaveValue -1 -1 -endTransaction $endTransaction] \
        [list null MustHaveValue -1 -1 -errorTransaction $errorTransaction]] \
        $argv

    set count(0) $options(-count0,value)
    set count(1) $options(-count1,value)
    set count(2) $options(-count2,value)
    set count(3) $options(-count3,value)
    set count(4) $options(-count4,value)
    set count(5) $options(-count5,value)
................................................................................
    set noWorkload $options(-noWorkload,value)
    set priorities $options(-priorities,value)
    set exitOnFail $options(-exitOnFail,value)
    set coTaskMem $options(-coTaskMem,value)
    set noTrace $options(-noTrace,value)
    set beginTransaction $options(-beginTransaction,value)
    set endTransaction $options(-endTransaction,value)
    set errorTransaction $options(-errorTransaction,value)
  }

  #############################################################################

  #
  # NOTE: Load custom per-user and/or per-host test settings.  Currently, this
  #       is done after processing the command line options.  The settings file
................................................................................
      [appendArgs \" $beginTransaction \"] : "none"}] \n]

  tputs $test_channel [appendArgs \
      "---- end transaction SQL is " \
      [expr {[string length $endTransaction] > 0 ? \
      [appendArgs \" $endTransaction \"] : "none"}] \n]

  tputs $test_channel [appendArgs \
      "---- error transaction SQL is " \
      [expr {[string length $errorTransaction] > 0 ? \
      [appendArgs \" $errorTransaction \"] : "none"}] \n]

  #############################################################################

  #
  # NOTE: Create the workload priority array based on the priority list seen
  #       on the command line, if any.
  #
  array set priority $priorities
................................................................................
          sql execute $db [appendArgs "INSERT INTO " $table \
              "(x, y, z) VALUES('" [format %lX [expr {random()}]] \
              "', '" [base64 encode -- [expr {randstr($count2)}]] \
              "', 'small');"]
          endTransaction $db
          showTest E
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest e
          } else {
            failTest e $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "INSERT INTO " $table \
              "(x, y, z) VALUES('" [format %lX [expr {random()}]] \
              "', RANDOMBLOB(" $count3 "), 'big');"]
          endTransaction $db
          showTest F
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest f
          } else {
            failTest f $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "UPDATE " $table \
              " SET y = '" [base64 encode -- [expr {randstr($count2)}]] \
              "' WHERE x LIKE '" [format %X $index] "%' AND z = 'small';"]
          endTransaction $db
          showTest G
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest g
          } else {
            failTest g $error
          }
        }
      }
................................................................................
          beginTransaction $db
          sql execute $db [appendArgs "UPDATE " $table \
              " SET y = RANDOMBLOB(" $count3 ") WHERE x LIKE '" \
              [format %X $index] "%' AND z = 'big';"]
          endTransaction $db
          showTest H
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest h
          } else {
            failTest h $error
          }
        }
      }
................................................................................
        if {[catch {
          beginTransaction $db
          sql execute $db [appendArgs "DELETE FROM " $table \
              " WHERE x LIKE '" [format %X $index] "%' AND z = 'small';"]
          endTransaction $db
          showTest I
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest i
          } else {
            failTest i $error
          }
        }
      }
................................................................................
        if {[catch {
          beginTransaction $db
          sql execute $db [appendArgs "DELETE FROM " $table \
              " WHERE x LIKE '" [format %X $index] "%' AND z = 'big';"]
          endTransaction $db
          showTest J
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest j
          } else {
            failTest j $error
          }
        }
      }
................................................................................
          set result [sql execute -execute scalar $db \
              "PRAGMA integrity_check;"]
          if {$result ne "ok"} then {
            error [appendArgs "integrity check failed: " $result]
          }
          showTest R
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest r
          } else {
            failTest r $error
          }
        }
      }
................................................................................
              ") FROM s; WITH s(i) AS " \
              "(SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<" \
              $count5 ") INSERT INTO t3 SELECT RANDOMBLOB(" $count3 \
              ") FROM s; DELETE FROM t3;"]
          endTransaction $db
          showTest W
        } error]} then {
          catch {errorTransaction $db}
          if {[isExpectedError $error]} then {
            showTest w
          } else {
            failTest w $error
          }
        }
      }
................................................................................
  rename showTest ""
  rename waitTest ""
  rename delayTest ""
  rename initTest ""
  rename isExpectedError ""
  rename formatWorkloadTime ""
  rename formatWorkloadResult ""
  rename errorTransaction ""
  rename endTransaction ""
  rename beginTransaction ""
  rename setupWorkloadFileDb ""
  rename setupWorkloadMemDb ""

  catch {
    #
................................................................................
  rename cleanupLogging ""
  rename setupLogging ""

  unset -nocomplain result thread index workload priority journalMode \
      pageSize noWorkload priorities srcDb db fileName compiled options \
      count times logFileName logListener event timeout connection \
      indicators iterations exitOnFail coTaskMem noTrace beginTransaction \
      endTransaction errorTransaction failures status workloadNames \
      workloadCallbacks
} -time true -constraints {eagle command.object monoBug40 command.sql\
compile.DATA SQLite System.Data.SQLite compileCSharp} -result {0}}

###############################################################################

#
# NOTE: Report after test.

Changes to lib/System.Data.SQLite/settings.stress.mistachkin.eagle.

12
13
14
15
16
17
18

19
20

21
22
23
# set count(3) 10000;     # Workload "small" data chunk size, in bytes.
# set count(5) 209715200; # Maximum heap memory to exclude at one time.
# set journalMode WAL;    # Initial journal mode for database files.
# set pageSize 4096;      # Initial page size for database files.
# set noWorkload [list];  # Workloads to be omitted from the run, by index.
# set exitOnFail true;    # Halt testing and exit process on test failure?
# set noTrace true;       # Disable SQLite trace logging to a file?

# set beginTransaction "BEGIN"; # SQL to execute before modifying the database.
# set endTransaction "COMMIT";  # SQL to execute after modifying the database.


# addRuntimeOption sharedCache
# addRuntimeOption dmlOnly







>
|
|
>



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# set count(3) 10000;     # Workload "small" data chunk size, in bytes.
# set count(5) 209715200; # Maximum heap memory to exclude at one time.
# set journalMode WAL;    # Initial journal mode for database files.
# set pageSize 4096;      # Initial page size for database files.
# set noWorkload [list];  # Workloads to be omitted from the run, by index.
# set exitOnFail true;    # Halt testing and exit process on test failure?
# set noTrace true;       # Disable SQLite trace logging to a file?

# set beginTransaction "BEGIN";    # SQL just before modifying the database.
# set endTransaction "COMMIT";     # SQL just after modifying the database.
# set errorTransaction "ROLLBACK"; # SQL just after a database modification error.

# addRuntimeOption sharedCache
# addRuntimeOption dmlOnly