Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests always fail if I have more than one test file extends StreamingSuiteBase #341

Open
imtiny opened this issue Jul 1, 2021 · 1 comment

Comments

@imtiny
Copy link

imtiny commented Jul 1, 2021

HI , thanks for the amazing library.

Here, I have a issue about using it , if I have more than one test, it always fail with error:

java.lang.IllegalStateException: Only one StreamingContext may be started in this JVM. Currently running StreamingContext was started atorg.apache.spark.streaming.StreamingContext.start(StreamingContext.scala:574)
[info] com.holdenkarau.spark.testing.StreamingSuiteCommon.withOutputAndStreamingContext(StreamingSuiteCommon.scala:121)
[info] com.holdenkarau.spark.testing.StreamingSuiteCommon.withOutputAndStreamingContext$(StreamingSuiteCommon.scala:114)
[info] net.truchat.sparkstreaming.AllStreamTest.withOutputAndStreamingContext(AllStreamTest.scala:7)
[info] com.holdenkarau.spark.testing.StreamingSuiteBase.testOperation(StreamingSuiteBase.scala:158)
[info] com.holdenkarau.spark.testing.StreamingSuiteBase.testOperation$(StreamingSuiteBase.scala:149)

If I put the two simple streaming tests in one test file with extends FunSuite with StreamingSuiteBase, it works.

My tests libs are as follows:

libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.9",
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.9" % "test",
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.9" % Test,
libraryDependencies += "com.holdenkarau" %% "spark-testing-base" % "3.1.2_1.1.0" % Test,

Scala version : 2.12.14

Thanks

@holdenk
Copy link
Owner

holdenk commented Nov 7, 2022

Do you have parallel tests enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants