Errors when running my own unit tests


  • Anonymous

    I have a test suite that I run which tests classes that use JDBM.

    On Linux they all work fine. On Windows XP, *in a VM*, I get a lot of failures. For instance:

    java.lang.Error: Offset too large for record header (blockId=3, pos=26587, headerSize=8, pageSize=8192)
    at jdbm.recman.RecordHeader.<init>(
    at jdbm.recman.PhysicalRowIdManager.allocNew(
    at jdbm.recman.PhysicalRowIdManager.alloc(
    at jdbm.recman.PhysicalRowIdManager.insert(
    at jdbm.recman.BaseRecordManager.update(
    at jdbm.recman.CacheRecordManager.updateCacheEntries(
    at jdbm.recman.CacheRecordManager.commit(
    at com.elsten.bliss.platform.tagindex.JdbmTagIndex.postModification(

    java.lang.Error: double get for block 0
    at jdbm.recman.RecordFile.get(
    at jdbm.recman.PhysicalRowIdManager.write(
    at jdbm.recman.PhysicalRowIdManager.insert(
    at jdbm.recman.BaseRecordManager.insert(
    at jdbm.recman.BaseRecordManager.getNameDirectory(
    at jdbm.recman.BaseRecordManager.getNamedObject(
    at jdbm.recman.CacheRecordManager.getNamedObject(
    at com.elsten.bliss.platform.tagindex.JdbmTagIndex.getTree(

    It is not consistent which tests fail - each time it changes.

    Any ideas what I'm doing wrong? Is it the speed in which the test cases are run one after the other? I'd like to get all my tests passing on Windows.

  • Alex Boisvert
    Alex Boisvert

    Windows is more finiky with open file descriptors; for example it won't let you delete a file if the file is open whereas linux is happy to do that.  

    Speculating, one thing to check is to make sure your tests properly close JDBM files before they are deleted + reopened by another test.



  • Anonymous

    Probably not! Will do.