1

http://www.playframework.org/documentation/2.0.1/JavaFunctionalTestで入手可能な実際の HTTP サーバーの開始例を複製しようとしていますが、プレイ テストでこのヘルパーを使用して複数の @Test が実行される場合

running(testServer(3333)

2 番目の @Test クラスは失敗します

ここにJavaスタックトレースがあります:

[error] Test controllers.v1_0.api.UsersTest.createAndRetreiveAndDeleteUser
failed: Promise timed out after 5000 : MILLISECONDS
[error]     at play.api.libs.concurrent.STMPromise$$anonfun$await$1.apply(Promise.scala:158)
[error]     at play.api.libs.concurrent.STMPromise$$anonfun$await$1.apply(Promise.scala:154)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.runBlock(InTxnImpl.scala:538)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.topLevelAttempt(InTxnImpl.scala:494)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.topLevelAtomicImpl(InTxnImpl.scala:365)
[error]     at scala.concurrent.stm.ccstm.InTxnImpl.atomic(InTxnImpl.scala:244)
[error]     at scala.concurrent.stm.ccstm.CCSTMExecutor.apply(CCSTMExecutor.scala:24)
[error]     at play.api.libs.concurrent.STMPromise.await(Promise.scala:154)
[error]     at play.api.libs.concurrent.Promise$class.await(Promise.scala:44)
[error]     at play.api.libs.concurrent.STMPromise.await(Promise.scala:113)
[error]     at play.api.libs.concurrent.Promise$class.value(Promise.scala:42)
[error]     at play.api.libs.concurrent.STMPromise.value(Promise.scala:113)
[error]     at play.libs.F$Promise.get(F.java:90)
[error]     at controllers.v1_0.api.UsersTest.createUserTest(UsersTest.java:50)
[error]     at controllers.v1_0.api.UsersTest.access$000(UsersTest.java:18)
[error]     at controllers.v1_0.api.UsersTest$1.run(UsersTest.java:25)
[error]     at play.test.Helpers.running(Helpers.java:317)
[error]     at controllers.v1_0.api.UsersTest.createAndRetreiveAndDeleteUser(UsersTest.java:22)

タイムアウトを増やしても役に立ちません。

助けてくれてありがとう、アンドレア

4

0 に答える 0