-C Always\sdeclare\sthe\ssqlite3WhereTrace\svariable,\seven\sfor\snon-debug\sbuilds.
-D 2020-12-20T14:51:17.806
+C Add\sthe\s--timer\soption\sto\sfuzzcheck.\s\sGet\sthe\s--timeout\soption\sworking\sin\nfuzzcheck\swhen\srunning\sdbsql\stests.
+D 2020-12-21T12:14:59.759
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634
F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830
F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2
-F test/fuzzcheck.c 5f81f2cc65f13068620245f2e2c6059657d3b26be476df379ae2da539f17676d
+F test/fuzzcheck.c 95427205d6cedb8fdb95bf7738e95785c790febf782d9c1e6067baaa1adc871d
F test/fuzzdata1.db d36e88741b4f23bcbaaf55b006290669d03c6c891cf13c7b3a53bc1b097b693f
F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P b79f59f9ad897d5bd4b9d17e6219bc765b02450bfe14dc020485f221ba6b02cb
-R 44577f8a1c7518c34582de96a91b2e8b
+P 88d93ee380b6fd87474545f20ade874ba05c784c787ce9c45ebfcffed3795308
+R 27ec1c9c08574b257c1035ec83dd9754
U drh
-Z 174bdbab8294579fbf084a8c0c09510f
+Z b0ca2a90328c04cad0677f000624e900
}
}
-/* Return the current wall-clock time */
+/* Return the current wall-clock time
+**
+** The number of milliseconds since the julian epoch.
+** 1907-01-01 00:00:00 -> 210866716800000
+** 2021-01-01 00:00:00 -> 212476176000000
+*/
static sqlite3_int64 timeOfDay(void){
static sqlite3_vfs *clockVfs = 0;
sqlite3_int64 t;
sqlite3_int64 iNow = timeOfDay();
int rc = iNow>=p->iCutoffTime;
sqlite3_int64 iDiff = iNow - p->iLastCb;
+ /* printf("time-remaining: %lld\n", p->iCutoffTime - iNow); */
if( iDiff > p->mxInterval ) p->mxInterval = iDiff;
p->nCb++;
if( rc==0 && p->mxCb>0 && p->mxCb<=p->nCb ) rc = 1;
}
/* Invoke this routine to run a single test case */
-int runCombinedDbSqlInput(const uint8_t *aData, size_t nByte){
+int runCombinedDbSqlInput(const uint8_t *aData, size_t nByte, int iTimeout){
int rc; /* SQLite API return value */
int iSql; /* Index in aData[] of start of SQL */
unsigned char *aDb = 0; /* Decoded database content */
** elapsed since the start of the test.
*/
cx.iLastCb = timeOfDay();
- cx.iCutoffTime = cx.iLastCb + giTimeout; /* Now + giTimeout seconds */
+ cx.iCutoffTime = cx.iLastCb + (iTimeout<giTimeout ? iTimeout : giTimeout);
cx.mxCb = mxProgressCb;
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
sqlite3_progress_handler(cx.db, 10, progress_handler, (void*)&cx);
" --skip N Skip the first N test cases\n"
" --spinner Use a spinner to show progress\n"
" --sqlid N Use only SQL where sqlid=N\n"
-" --timeout N Abort if any single test needs more than N seconds\n"
+" --timeout N Maximum time for any one test in N millseconds\n"
" -v|--verbose Increased output. Repeat for more output.\n"
" --vdbe-debug Activate VDBE debugging.\n"
);
const char *zFailCode = 0; /* Value of the TEST_FAILURE env variable */
int cellSzCkFlag = 0; /* --cell-size-check */
int sqlFuzz = 0; /* True for SQL fuzz. False for DB fuzz */
- int iTimeout = 120; /* Default 120-second timeout */
+ int iTimeout = 120000; /* Default 120-second timeout */
int nMem = 0; /* Memory limit override */
int nMemThisDb = 0; /* Memory limit set by the CONFIG table */
char *zExpDb = 0; /* Write Databases to files in this directory */
int nativeMalloc = 0; /* Turn off MEMSYS3/5 and lookaside if true */
sqlite3_vfs *pDfltVfs; /* The default VFS */
int openFlags4Data; /* Flags for sqlite3_open_v2() */
+ int bTimer = 0; /* Show elapse time for each test */
int nV; /* How much to increase verbosity with -vvvv */
+ sqlite3_int64 tmStart; /* Start of each test */
registerOomSimulator();
sqlite3_initialize();
if( strcmp(z,"spinner")==0 ){
bSpinner = 1;
}else
+ if( strcmp(z,"timer")==0 ){
+ bTimer = 1;
+ }else
if( strcmp(z,"sqlid")==0 ){
if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]);
onlySqlid = integerValue(argv[++i]);
*/
if( !verboseFlag && !quietFlag && !bSpinner ) printf("%s:", zDbName);
for(pSql=g.pFirstSql; pSql; pSql=pSql->pNext){
+ tmStart = timeOfDay();
if( isDbSql(pSql->a, pSql->sz) ){
sqlite3_snprintf(sizeof(g.zTestName), g.zTestName, "sqlid=%d",pSql->id);
if( bSpinner ){
if( nSkip>0 ){
nSkip--;
}else{
- runCombinedDbSqlInput(pSql->a, pSql->sz);
+ runCombinedDbSqlInput(pSql->a, pSql->sz, iTimeout);
}
nTest++;
+ if( bTimer ){
+ sqlite3_int64 tmEnd = timeOfDay();
+ printf("%lld %s\n", tmEnd - tmStart, g.zTestName);
+ }
g.zTestName[0] = 0;
disableOom();
continue;
sqlite3_limit(db, SQLITE_LIMIT_LENGTH, 100000000);
sqlite3_limit(db, SQLITE_LIMIT_LIKE_PATTERN_LENGTH, 50);
if( cellSzCkFlag ) runSql(db, "PRAGMA cell_size_check=ON", runFlags);
- setAlarm(iTimeout);
+ setAlarm((iTimeout+999)/1000);
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
if( sqlFuzz || vdbeLimitFlag ){
sqlite3_progress_handler(db, 100000, progressHandler,
}
reformatVfs();
nTest++;
+ if( bTimer ){
+ sqlite3_int64 tmEnd = timeOfDay();
+ printf("%lld %s\n", tmEnd - tmStart, g.zTestName);
+ }
g.zTestName[0] = 0;
/* Simulate an error if the TEST_FAILURE environment variable is "5".