Merge pull request #1936 from akka/wip-3738-memory-leaks-in-tests-patriknw

=act #3738 Fix memory leaks in tests
This commit is contained in:
Patrik Nordwall 2014-01-20 02:51:49 -08:00
commit 37eddd716c
6 changed files with 34 additions and 12 deletions

View file

@ -10,8 +10,9 @@ import scala.collection.immutable.Seq
//#plugin-imports
import com.typesafe.config._
import org.scalatest.WordSpec
import scala.concurrent.duration._
import akka.testkit.TestKit
import akka.actor.ActorSystem
//#plugin-imports
@ -69,8 +70,12 @@ class PersistencePluginDocSpec extends WordSpec {
//#snapshot-store-plugin-config
"""
val system = ActorSystem("doc", ConfigFactory.parseString(providerConfig).withFallback(ConfigFactory.parseString(PersistencePluginDocSpec.config)))
val extension = Persistence(system)
val system = ActorSystem("PersistencePluginDocSpec", ConfigFactory.parseString(providerConfig).withFallback(ConfigFactory.parseString(PersistencePluginDocSpec.config)))
try {
Persistence(system)
} finally {
TestKit.shutdownActorSystem(system, 10.seconds, false)
}
}
}

View file

@ -5,11 +5,11 @@
package docs.persistence
import com.typesafe.config._
import scala.concurrent.duration._
import org.scalatest.WordSpec
import akka.actor.ActorSystem
import akka.serialization.{ Serializer, SerializationExtension }
import akka.testkit.TestKit
class PersistenceSerializerDocSpec extends WordSpec {
@ -29,7 +29,12 @@ class PersistenceSerializerDocSpec extends WordSpec {
//#custom-serializer-config
""".stripMargin
SerializationExtension(ActorSystem("doc", ConfigFactory.parseString(customSerializerConfig)))
val system = ActorSystem("PersistenceSerializerDocSpec", ConfigFactory.parseString(customSerializerConfig))
try {
SerializationExtension(system)
} finally {
TestKit.shutdownActorSystem(system, 10.seconds, false)
}
}
class MyPayload