Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2144

MainStartTest test fails when methods are executed in reverse order

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • karaf
    • None
    • java version "1.7.0_09"
      OpenJDK Runtime Environment (IcedTea7 2.3.4) (ArchLinux build 7.u9_2.3.4-1-x86_64)
      OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

    Description

      Sometimes I get spammed with this Exception when building karaf

      Jan 27, 2013 2:56:20 AM org.apache.karaf.main.lock.SimpleFileLock lock
      INFO: Trying to lock /home/christoph/oss/karaf/main/target/test-classes/test-karaf-home/lock
      java.nio.channels.OverlappingFileLockException
      	at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
      	at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
      	at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1017)
      	at java.nio.channels.FileChannel.tryLock(FileChannel.java:1154)
      	at org.apache.karaf.main.lock.SimpleFileLock.lock(SimpleFileLock.java:63)
      	at org.apache.karaf.main.lock.LockManager.runLockManager(LockManager.java:61)
      	at org.apache.karaf.main.lock.LockManager.access$000(LockManager.java:21)
      	at org.apache.karaf.main.lock.LockManager$1.run(LockManager.java:49)
      

      In Java 7 the reflection-implementation was changed so that tests in the same test-class are not necessarily executed in the same order they are written. Changing the order of the tests and using JDK-6 makes this issue 100% reproducible for me.

      This may cause the Tests in MainStartTest to be executed in reverse order, which will cause "testAutoStart" to fail because "testStopWithTimeout" did not clean up correctly.

      Attachments

        1. test-fix.patch
          2 kB
          Christoph Gritschenberger

        Activity

          People

            pieber Andreas Pieber
            christophg Christoph Gritschenberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: