Week of obscure bugs
Thu Jun 19 10:14:00 CDT 2008
The forkmode='once' test speed-up caused a bug to come to the surface only on Windows machines. On Linux (and other unix-like) file systems, you can delete a file while a process has it open, as deleting a file really translates to unlinking an inode. The data on disk is kept in nodes with reference counts which will be returned to the pool when all referencing inodes and handles are released. This was once a way to hide a data file on disk, create and open it, delete it, and use it.
Windows file system does not behave the same way and attempting to delete a file that is open will result in an error at most and a failure to delete at minimum.
This came into play because the hxtt dbf driver does not release the file right away when you close the sql connection. There is a property delayClose with a default value of 3 seconds. Our test was closing the database connection and turning around to delete the file. Works fine on Linux. Windows, this causes an error. So, we can sleep for a few seconds in the test (ugh!) or we can set delayClose to 0. Will be interesting to see if that results in a performance problem.
Then was the case of the test passing everywhere but only failing on one developer's machine. Turns out we have a test sensitive to time zone and his machine's time zone was set to North Dakota/New Salem. We have no idea how that got set. Still looking at the details on the date creation in the code under test.
I need to get some things done and could use some time back on the project instead of on 'strange bug safari.'