Skip to content

Commit

Permalink
Second attempt to fix flaky test
Browse files Browse the repository at this point in the history
Not sure why these two specs fail, maybe because of the different execution context based on Pekko?
  • Loading branch information
Ostrzyciel committed Oct 17, 2023
1 parent 980697d commit 33b3a57
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.apache.jena.sparql.util.IsoMatcher
import org.apache.jena.sys.JenaSystem
import org.apache.pekko.actor.ActorSystem
import org.apache.pekko.stream.scaladsl.*
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
Expand All @@ -20,12 +21,13 @@ import scala.concurrent.ExecutionContext
import scala.concurrent.duration.*
import scala.jdk.CollectionConverters.*

class CrossStreamingSpec extends AnyWordSpec, Matchers, ScalaFutures:
class CrossStreamingSpec extends AnyWordSpec, Matchers, ScalaFutures, BeforeAndAfterAll:
implicit val actorSystem: ActorSystem = ActorSystem()
implicit val ec: ExecutionContext = actorSystem.getDispatcher
implicit val defaultPatience: PatienceConfig = PatienceConfig(timeout = 5.seconds, interval = 50.millis)

JenaSystem.init()

override def beforeAll(): Unit =
JenaSystem.init()

private val implementations: Seq[(String, TestStream)] = Seq(
("Jena", JenaTestStream),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import eu.ostrzyciel.jelly.core.JellyOptions
import eu.ostrzyciel.jelly.core.proto.v1.RdfStreamOptions
import org.apache.jena.sys.JenaSystem
import org.apache.pekko.actor.ActorSystem
import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
Expand All @@ -13,10 +14,11 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream, File, FileInputStre
/**
* Tests for IO ser/des (Jena RIOT, RDF4J Rio, and semi-reactive IO over Pekko Streams).
*/
class IoSerDesSpec extends AnyWordSpec, Matchers, ScalaFutures:
class IoSerDesSpec extends AnyWordSpec, Matchers, ScalaFutures, BeforeAndAfterAll:
implicit val as: ActorSystem = ActorSystem("test")

JenaSystem.init()
override def beforeAll(): Unit =
JenaSystem.init()

val casesTriples: Seq[(String, File)] = Seq[String](
"weather.nt", "p2_ontology.nt", "nt-syntax-subm-01.nt", "rdf-star.nt", "rdf-star-blanks.nt"
Expand Down

0 comments on commit 33b3a57

Please sign in to comment.