Dennis Cote schrieb:
After fixing the exclusive2 test and running the quick test with no errors, I decided to try the complete test suite, alltest.

I am getting failures on test misc7-6.1.x:

   misc7-6.1.1... Ok
   misc7-6.1.2... Ok
   misc7-6.1.3...
   Expected: [1]
        Got: [0]
   misc7-6.1.4... Ok
   misc7-6.1.5...
   Expected: [1]
        Got: [0]
   misc7-6.1.6... Ok

After this the testfixture got stuck in busy loop. It was using 99% of CPU, doing no read or write I/O. According to Task Manager it was doing "Other I/O" at a rate of about 6 per second. It was not hung since a simple Ctrl-C interrupt exited the test.

Looking at the source for this test, I see a hint of what is likely the problem in the first comment.

   #--------------------------------------------------------------------
   # The following tests, misc7-6.* test the libraries behaviour when
   # it cannot open a file. To force this condition, we use up all the
   # file-descriptors before running sqlite. This probably only works
   # on unix.
   #

   proc use_up_files {} {
     set ret [list]
     catch {
       while 1 { lappend ret [open test.db] }
     }
     return $ret
   }

   proc do_fileopen_test {prefix sql} {
     set fd_list [use_up_files]
     set ::go 1
     set ::n 1
     set ::sql $sql
     while {$::go} {
       catch {db close}
       do_test ${prefix}.${::n} {
         set rc [catch {
           sqlite db test.db
           db eval $::sql
         } msg]
         if {$rc == 0} {set ::go 0}
             expr {$rc == 0 || ($rc == 1 && [string first unable $msg]==0)}
       } 1
           close [lindex $fd_list 0]
       set fd_list [lrange $fd_list 1 end]
       incr ::n
     }
     foreach fd $fd_list {
       close $fd
     }
     db close
   }

   execsql { CREATE TABLE abc(a PRIMARY KEY, b, c); }
   db close

   do_fileopen_test misc7-6.1 {
     BEGIN;
     INSERT INTO abc VALUES(1, 2, 3);
     INSERT INTO abc VALUES(2, 3, 4);
     INSERT INTO abc SELECT a+2, b, c FROM abc;
     COMMIT;
   }

It seems like the use_up_files command must work sometimes, since several iterations of the test worked (i.e. 6.1.1 and 6.1.2). I'm not sure what to make of the sequence of test failures and successes before it finally hangs.

Since the comment indicates that this test is designed for a unix OS, shouldn't it be testing for that OS before running? I think it should be skipped much like the tests that depend upon the SQLITE_MEMDEBUG being defined.

Does anyone with better TCL knowledge have any recommendations for either making these tests work under Windows, or detecting the OS so the tests can be skipped when not running under that OS?

Skipping it would simply be something like:

if {$::tcl_platform(platform) != "windows"} {
        # code for non-windows
}

or inverted:

if {$::tcl_platform(platform) == "unix"} {
        # code for unix platforms
}

If you need more specific platform details, take a look at:
http://wiki.tcl.tk/tcl_platform

It lists values for tcl_platform for various OS.

Michael

--
Michael Schlenker
Software Engineer

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Straße 1-3               Fax:    +49 (421) 20153-41
28359 Bremen
http://www.contact.de/          E-Mail: [EMAIL PROTECTED]

Sitz der Gesellschaft: Bremen | Geschäftsführer: Karl Heinz Zachries
Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to