Sequential test suite error with Scalatest in Play 2.2, Slick 3 and HikariCP pool db

43 views
Skip to first unread message

Dmitry Ivanov

unread,
Jan 28, 2016, 12:20:15 AM1/28/16
to Slick / ScalaQuery

Now I update my application to Play 2.4 and Slick 3. To test Application I use Scalatest and several test suites.

The issue in next. First test suite is performed correctly, but the second one crash with next error:

Testing started at 6:29 ...

2016-01-28 06:29:51 Logger configuration in conf files is deprecated and has no effect. Use a logback configuration file instead. 2016-01-28 06:30:00 Slf4jLogger started 2016-01-28 06:30:01 Loading Test Data in Test Mode 2016-01-28 06:30:01 waiting test data to be inserted 2016-01-28 06:30:05 HikariCP pool db is starting. 2016-01-28 06:30:08 done test data dealing 2016-01-28 06:30:12 HikariCP pool db is shutting down.

Task slick.backend.DatabaseComponent$DatabaseDef$$anon$2@1b4b7b30 rejected from java.util.concurrent.ThreadPoolExecutor@3898128a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3] java.util.concurrent.RejectedExecutionException: Task slick.backend.DatabaseComponent$DatabaseDef$$anon$2@1b4b7b30 rejected from java.util.concurrent.ThreadPoolExecutor@3898128a[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 3] ..........

I make small project that allow to see the issue: https://github.com/DmitryIvanovIAMM/test

Interesting, that for second test suite the application initialize model correctly, but something close HikariCP pool db after this and we have error. I see similar issue (f.e.https://github.com/playframework/play-slick/issues/345 ) but can't figure out how to solve problem in my case.


Thanks for any help!

Dmitry Ivanov

unread,
Jan 31, 2016, 9:16:06 AM1/31/16
to Slick / ScalaQuery
I refactor DAOs objects to case classes and tests in test application start work. But in real application there were the same errors, because controllers are also object. In fact, DB requests that was made from DAOs are correct, the requests that was made from controllers done with mentioned error. So, in real application I move all DB queries to DAOs and all tests suites done correct.

Reply all
Reply to author
Forward
0 new messages