Details
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.