Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Errors when running my own unit tests

Help
Anonymous
2010-07-29
2013-06-03

  • Anonymous
    2010-07-29

    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>(RecordHeader.java:75)
    at jdbm.recman.PhysicalRowIdManager.allocNew(PhysicalRowIdManager.java:297)
    at jdbm.recman.PhysicalRowIdManager.alloc(PhysicalRowIdManager.java:233)
    at jdbm.recman.PhysicalRowIdManager.insert(PhysicalRowIdManager.java:81)
    at jdbm.recman.BaseRecordManager.update(BaseRecordManager.java:531)
    at jdbm.recman.CacheRecordManager.updateCacheEntries(CacheRecordManager.java:465)
    at jdbm.recman.CacheRecordManager.commit(CacheRecordManager.java:392)
    at com.elsten.bliss.platform.tagindex.JdbmTagIndex.postModification(JdbmTagIndex.java:456)

    java.lang.Error: double get for block 0
    at jdbm.recman.RecordFile.get(RecordFile.java:466)
    at jdbm.recman.PhysicalRowIdManager.write(PhysicalRowIdManager.java:406)
    at jdbm.recman.PhysicalRowIdManager.insert(PhysicalRowIdManager.java:82)
    at jdbm.recman.BaseRecordManager.insert(BaseRecordManager.java:410)
    at jdbm.recman.BaseRecordManager.getNameDirectory(BaseRecordManager.java:754)
    at jdbm.recman.BaseRecordManager.getNamedObject(BaseRecordManager.java:675)
    at jdbm.recman.CacheRecordManager.getNamedObject(CacheRecordManager.java:422)
    at com.elsten.bliss.platform.tagindex.JdbmTagIndex.getTree(JdbmTagIndex.java:104)

    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
    2010-07-29

    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.

    alex

     

  • Anonymous
    2010-07-29

    Probably not! Will do.