Maven тест не завершен - PullRequest
2 голосов
/ 17 июня 2011

Когда я запускаю тест mvn Maven успешно выполняет все тесты, а затем переходит в бесконечный цикл ожидания Я вижу процесс Java в диспетчере задач, и мне нужно убить его, прежде чем maven вернется с этим сообщением об ошибке

Выполнено тестов: 3, сбоев: 0, ошибок: 0, пропущено: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:33.949s
[INFO] Finished at: Fri Jun 17 14:50:01 EDT 2011
[INFO] Final Memory: 5M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
4:test (default-test) on project EDIFileHandling: There are test failures.
[ERROR]
[ERROR] Please refer to c:\code\target\surefire-reports for the individual test
results.

Любая помощь приветствуется.

Спасибо

R

C:\Users\Raghuveer.Rao>jstack 7256 2011-06-17 15:24:55 Full thread dump Java HotSpot(TM) Client VM (20.0-b11 mixed mode, sharing):</p> <p>"Thread-2" prio=6 tid=0x03ed3000 nid=0x14d0 waiting for monitor entry [0x04ddf00 0] java.lang.Thread.State: BLOCKED (on object monitor) at org.hsqldb.Session.close(Unknown Source) - waiting to lock <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - locked <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23b8efe8> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23b90f30> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2951f1c0> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)</p> <p>"Thread-1" prio=6 tid=0x03ed2c00 nid=0x1fe0 waiting for monitor entry [0x04d8f00 0] java.lang.Thread.State: BLOCKED (on object monitor) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - waiting to lock <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23ba9568> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2910d510> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)</p> <p>"Low Memory Detector" daemon prio=6 tid=0x01bdac00 nid=0x1eb0 runnable [0x000000 00] java.lang.Thread.State: RUNNABLE</p> <p>"C1 CompilerThread0" daemon prio=10 tid=0x01bc8400 nid=0x18e8 waiting on conditi on [0x00000000] java.lang.Thread.State: RUNNABLE</p> <p>"Attach Listener" daemon prio=10 tid=0x01bc5400 nid=0x1ac0 waiting on condition [0x00000000] java.lang.Thread.State: RUNNABLE</p> <p>"Signal Dispatcher" daemon prio=10 tid=0x01bc2400 nid=0x1fbc runnable [0x0000000 0] java.lang.Thread.State: RUNNABLE</p> <p>"Finalizer" daemon prio=8 tid=0x01bbb800 nid=0x1c00 in Object.wait() [0x03cdf000 ] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x290702b0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) - locked <0x290702b0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)</p> <p>"Reference Handler" daemon prio=10 tid=0x01bba000 nid=0x810 in Object.wait() [0x 03c8f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x29070340> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:485) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) - locked <0x29070340> (a java.lang.ref.Reference$Lock)</p> <p>"main" prio=6 tid=0x00e29800 nid=0x1e20 in Object.wait() [0x001bf000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x294c4300> (a org.springframework.context.support.Abstrac tApplicationContext$3) at java.lang.Thread.join(Thread.java:1186) - locked <0x294c4300> (a org.springframework.context.support.AbstractApp licationContext$3) at java.lang.Thread.join(Thread.java:1239) at java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks. java:79) at java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.jav a:24) at java.lang.Shutdown.runHooks(Shutdown.java:79) at java.lang.Shutdown.sequence(Shutdown.java:123) at java.lang.Shutdown.exit(Shutdown.java:168) - locked <0x38b53ef8> (a java.lang.Class for java.lang.Shutdown) at java.lang.Runtime.exit(Runtime.java:90) at java.lang.System.exit(System.java:904) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j ava:986)</p> <p>"VM Thread" prio=10 tid=0x01b7e400 nid=0x1e10 runnable</p> <p>"VM Periodic Task Thread" prio=10 tid=0x01bec800 nid=0x1bac waiting on condition</p> <p>JNI global references: 1776</p> <h1>Found one Java-level deadlock:</h1> <p>"Thread-2": waiting to lock monitor 0x0467c1cc (object 0x23ba76f0, a org.hsqldb.Session), which is held by "Thread-1" "Thread-1": waiting to lock monitor 0x01bbf56c (object 0x292ce828, a org.hsqldb.SessionMan ager), which is held by "Thread-2"</p> <h1>Java stack information for the threads listed above:</h1> <p>"Thread-2": at org.hsqldb.Session.close(Unknown Source) - waiting to lock <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - locked <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23b8efe8> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23b90f30> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2951f1c0> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940) "Thread-1": at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - waiting to lock <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23ba9568> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2910d510> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)</p> <p>Found 1 deadlock.</p> <p>C:\Users\Raghuveer.Rao></p> <p>

1 Ответ

1 голос
/ 17 июня 2011

Плагин Maven surefire по умолчанию запускает новый процесс для запуска тестов.Это, вероятно, процесс, который вы убиваете.Когда maven замечает, что его дочерний процесс был прерван, он, вероятно, предполагает, что тесты не пройдены.

Посмотрите на /target/surefire-reports для подтверждения.Что вы можете сделать, чтобы помочь нам диагностировать проблему, так это найти идентификатор верного процесса (тот, который вы убиваете) и запустить:

$ jstack ID

Дамп стека расскажет вам, из-за чего тест завис.

...