org.scalatest.exceptions.TestFailedException: Assert on query failed: Add partitions: The code passed to eventually never returned normally. Attempted 3924 times over 1.0001915584 minutes. Last failure message: assertion failed: Partition [topic-4, 5] metadata not propagated after timeout. org.scalatest.concurrent.Eventually.tryTryAgain$1(Eventually.scala:432) org.scalatest.concurrent.Eventually.eventually(Eventually.scala:439) org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:391) org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479) org.scalatest.concurrent.Eventually.eventually(Eventually.scala:337) org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:336) org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479) org.apache.spark.sql.kafka010.KafkaTestUtils.waitUntilMetadataIsPropagated(KafkaTestUtils.scala:441) org.apache.spark.sql.kafka010.KafkaTestUtils.$anonfun$addPartitions$1(KafkaTestUtils.scala:235) scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158) Caused by: assertion failed: Partition [topic-4, 5] metadata not propagated after timeout scala.Predef$.assert(Predef.scala:223) org.apache.spark.sql.kafka010.KafkaTestUtils.$anonfun$waitUntilMetadataIsPropagated$1(KafkaTestUtils.scala:442) scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) org.scalatest.concurrent.Eventually.makeAValiantAttempt$1(Eventually.scala:395) org.scalatest.concurrent.Eventually.tryTryAgain$1(Eventually.scala:409) org.scalatest.concurrent.Eventually.eventually(Eventually.scala:439) org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:391) org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479) org.scalatest.concurrent.Eventually.eventually(Eventually.scala:337) org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:336) == Progress == AssertOnQuery(<condition>, ) AddKafkaData(topics = Set(topic-4), data = WrappedArray(1, 2, 3), message = ) CheckAnswer: [2],[3],[4] StopStream StartStream(ProcessingTime(0),org.apache.spark.util.SystemClock@1bf3530a,Map(),null) CheckAnswer: [2],[3],[4] StopStream AddKafkaData(topics = Set(topic-4), data = WrappedArray(4, 5, 6), message = ) StartStream(ProcessingTime(0),org.apache.spark.util.SystemClock@15c64d35,Map(),null) CheckAnswer: [2],[3],[4],[5],[6],[7] AddKafkaData(topics = Set(topic-4), data = WrappedArray(7, 8), message = ) CheckAnswer: [2],[3],[4],[5],[6],[7],[8],[9] => AssertOnQuery(<condition>, Add partitions) AddKafkaData(topics = Set(topic-4), data = WrappedArray(9, 10, 11, 12, 13, 14, 15, 16), message = ) CheckAnswer: [2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17] == Stream == Output Mode: Append Stream state: {KafkaV2[Subscribe[topic-4]]: {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}}} Thread state: alive Thread stack trace: java.lang.Thread.sleep(Native Method) org.apache.spark.sql.execution.streaming.MicroBatchExecution.$anonfun$runActivatedStream$1(MicroBatchExecution.scala:230) org.apache.spark.sql.execution.streaming.MicroBatchExecution$$Lambda$2188/93278099.apply$mcZ$sp(Unknown Source) org.apache.spark.sql.execution.streaming.ProcessingTimeExecutor.execute(TriggerExecutor.scala:56) org.apache.spark.sql.execution.streaming.MicroBatchExecution.runActivatedStream(MicroBatchExecution.scala:175) org.apache.spark.sql.execution.streaming.StreamExecution.org$apache$spark$sql$execution$streaming$StreamExecution$$runStream(StreamExecution.scala:332) org.apache.spark.sql.execution.streaming.StreamExecution$$anon$1.run(StreamExecution.scala:244) == Sink == 0: 1: [2] 2: [3] 3: [4] 4: [6] [7] [5] 5: [8] 6: [9] == Plan == == Parsed Logical Plan == WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca +- SerializeFromObject [input[0, int, false] AS value#10176] +- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int +- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2 +- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165] +- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}} == Analyzed Logical Plan == WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca +- SerializeFromObject [input[0, int, false] AS value#10176] +- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int +- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2 +- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165] +- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}} == Optimized Logical Plan == WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca +- SerializeFromObject [input[0, int, false] AS value#10176] +- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int +- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2 +- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165] +- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}} == Physical Plan == WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca +- *(1) SerializeFromObject [input[0, int, false] AS value#10176] +- *(1) MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, obj#10175: int +- *(1) DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2 +- *(1) Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165] +- *(1) Project [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156] +- *(1) MicroBatchScan[key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan
sbt.ForkMain$ForkError: org.scalatest.exceptions.TestFailedException:
Assert on query failed: Add partitions: The code passed to eventually never returned normally. Attempted 3924 times over 1.0001915584 minutes. Last failure message: assertion failed: Partition [topic-4, 5] metadata not propagated after timeout.
org.scalatest.concurrent.Eventually.tryTryAgain$1(Eventually.scala:432)
org.scalatest.concurrent.Eventually.eventually(Eventually.scala:439)
org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:391)
org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479)
org.scalatest.concurrent.Eventually.eventually(Eventually.scala:337)
org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:336)
org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479)
org.apache.spark.sql.kafka010.KafkaTestUtils.waitUntilMetadataIsPropagated(KafkaTestUtils.scala:441)
org.apache.spark.sql.kafka010.KafkaTestUtils.$anonfun$addPartitions$1(KafkaTestUtils.scala:235)
scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158)
Caused by: assertion failed: Partition [topic-4, 5] metadata not propagated after timeout
scala.Predef$.assert(Predef.scala:223)
org.apache.spark.sql.kafka010.KafkaTestUtils.$anonfun$waitUntilMetadataIsPropagated$1(KafkaTestUtils.scala:442)
scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
org.scalatest.concurrent.Eventually.makeAValiantAttempt$1(Eventually.scala:395)
org.scalatest.concurrent.Eventually.tryTryAgain$1(Eventually.scala:409)
org.scalatest.concurrent.Eventually.eventually(Eventually.scala:439)
org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:391)
org.scalatest.concurrent.Eventually$.eventually(Eventually.scala:479)
org.scalatest.concurrent.Eventually.eventually(Eventually.scala:337)
org.scalatest.concurrent.Eventually.eventually$(Eventually.scala:336)
== Progress ==
AssertOnQuery(<condition>, )
AddKafkaData(topics = Set(topic-4), data = WrappedArray(1, 2, 3), message = )
CheckAnswer: [2],[3],[4]
StopStream
StartStream(ProcessingTime(0),org.apache.spark.util.SystemClock@1bf3530a,Map(),null)
CheckAnswer: [2],[3],[4]
StopStream
AddKafkaData(topics = Set(topic-4), data = WrappedArray(4, 5, 6), message = )
StartStream(ProcessingTime(0),org.apache.spark.util.SystemClock@15c64d35,Map(),null)
CheckAnswer: [2],[3],[4],[5],[6],[7]
AddKafkaData(topics = Set(topic-4), data = WrappedArray(7, 8), message = )
CheckAnswer: [2],[3],[4],[5],[6],[7],[8],[9]
=> AssertOnQuery(<condition>, Add partitions)
AddKafkaData(topics = Set(topic-4), data = WrappedArray(9, 10, 11, 12, 13, 14, 15, 16), message = )
CheckAnswer: [2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12],[13],[14],[15],[16],[17]
== Stream ==
Output Mode: Append
Stream state: {KafkaV2[Subscribe[topic-4]]: {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}}}
Thread state: alive
Thread stack trace: java.lang.Thread.sleep(Native Method)
org.apache.spark.sql.execution.streaming.MicroBatchExecution.$anonfun$runActivatedStream$1(MicroBatchExecution.scala:230)
org.apache.spark.sql.execution.streaming.MicroBatchExecution$$Lambda$2188/93278099.apply$mcZ$sp(Unknown Source)
org.apache.spark.sql.execution.streaming.ProcessingTimeExecutor.execute(TriggerExecutor.scala:56)
org.apache.spark.sql.execution.streaming.MicroBatchExecution.runActivatedStream(MicroBatchExecution.scala:175)
org.apache.spark.sql.execution.streaming.StreamExecution.org$apache$spark$sql$execution$streaming$StreamExecution$$runStream(StreamExecution.scala:332)
org.apache.spark.sql.execution.streaming.StreamExecution$$anon$1.run(StreamExecution.scala:244)
== Sink ==
0:
1: [2]
2: [3]
3: [4]
4: [6] [7] [5]
5: [8]
6: [9]
== Plan ==
== Parsed Logical Plan ==
WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca
+- SerializeFromObject [input[0, int, false] AS value#10176]
+- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int
+- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2
+- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165]
+- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}}
== Analyzed Logical Plan ==
WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca
+- SerializeFromObject [input[0, int, false] AS value#10176]
+- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int
+- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2
+- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165]
+- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}}
== Optimized Logical Plan ==
WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca
+- SerializeFromObject [input[0, int, false] AS value#10176]
+- MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, class scala.Tuple2, [StructField(_1,StringType,true), StructField(_2,StringType,true)], obj#10175: int
+- DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2
+- Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165]
+- StreamingDataSourceV2Relation [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@36d0599e, KafkaV2[Subscribe[topic-4]], {"topic-4":{"2":2,"4":0,"1":3,"3":2,"0":1}}, {"topic-4":{"2":3,"4":0,"1":3,"3":2,"0":1}}
== Physical Plan ==
WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@ef7fcca
+- *(1) SerializeFromObject [input[0, int, false] AS value#10176]
+- *(1) MapElements org.apache.spark.sql.kafka010.KafkaSourceSuiteBase$$Lambda$3289/641125736@30c39666, obj#10175: int
+- *(1) DeserializeToObject newInstance(class scala.Tuple2), obj#10174: scala.Tuple2
+- *(1) Project [cast(key#10150 as string) AS key#10164, cast(value#10151 as string) AS value#10165]
+- *(1) Project [key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156]
+- *(1) MicroBatchScan[key#10150, value#10151, topic#10152, partition#10153, offset#10154L, timestamp#10155, timestampType#10156] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan
at org.scalatest.Assertions.newAssertionFailedException(Assertions.scala:528)
at org.scalatest.Assertions.newAssertionFailedException$(Assertions.scala:527)
at org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1560)
at org.scalatest.Assertions.fail(Assertions.scala:1089)
at org.scalatest.Assertions.fail$(Assertions.scala:1085)
at org.scalatest.FunSuite.fail(FunSuite.scala:1560)
at org.apache.spark.sql.streaming.StreamTest.failTest$1(StreamTest.scala:444)
at org.apache.spark.sql.streaming.StreamTest.executeAction$1(StreamTest.scala:646)
at org.apache.spark.sql.streaming.StreamTest.$anonfun$testStream$56(StreamTest.scala:770)
at org.apache.spark.sql.streaming.StreamTest.$anonfun$testStream$56$adapted(StreamTest.scala:757)
at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
at org.apache.spark.sql.streaming.StreamTest.liftedTree1$1(StreamTest.scala:757)
at org.apache.spark.sql.streaming.StreamTest.testStream(StreamTest.scala:756)
at org.apache.spark.sql.streaming.StreamTest.testStream$(StreamTest.scala:326)
at org.apache.spark.sql.kafka010.KafkaSourceTest.testStream(KafkaMicroBatchSourceSuite.scala:50)
at org.apache.spark.sql.kafka010.KafkaSourceSuiteBase.testFromLatestOffsets(KafkaMicroBatchSourceSuite.scala:1475)
at org.apache.spark.sql.kafka010.KafkaSourceSuiteBase.$anonfun$new$117(KafkaMicroBatchSourceSuite.scala:1214)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.FunSuiteLike$$anon$1.apply(FunSuiteLike.scala:186)
at org.apache.spark.SparkFunSuite.withFixture(SparkFunSuite.scala:149)
at org.scalatest.FunSuiteLike.invokeWithFixture$1(FunSuiteLike.scala:184)
at org.scalatest.FunSuiteLike.$anonfun$runTest$1(FunSuiteLike.scala:196)
at org.scalatest.SuperEngine.runTestImpl(Engine.scala:289)
at org.scalatest.FunSuiteLike.runTest(FunSuiteLike.scala:196)
at org.scalatest.FunSuiteLike.runTest$(FunSuiteLike.scala:178)
at org.apache.spark.SparkFunSuite.org$scalatest$BeforeAndAfterEach$$super$runTest(SparkFunSuite.scala:56)
at org.scalatest.BeforeAndAfterEach.runTest(BeforeAndAfterEach.scala:221)
at org.scalatest.BeforeAndAfterEach.runTest$(BeforeAndAfterEach.scala:214)
at org.apache.spark.SparkFunSuite.runTest(SparkFunSuite.scala:56)
at org.scalatest.FunSuiteLike.$anonfun$runTests$1(FunSuiteLike.scala:229)
at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:396)
at scala.collection.immutable.List.foreach(List.scala:392)
at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:384)
at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:379)
at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:461)
at org.scalatest.FunSuiteLike.runTests(FunSuiteLike.scala:229)
at org.scalatest.FunSuiteLike.runTests$(FunSuiteLike.scala:228)
at org.scalatest.FunSuite.runTests(FunSuite.scala:1560)
at org.scalatest.Suite.run(Suite.scala:1147)
at org.scalatest.Suite.run$(Suite.scala:1129)
at org.scalatest.FunSuite.org$scalatest$FunSuiteLike$$super$run(FunSuite.scala:1560)
at org.scalatest.FunSuiteLike.$anonfun$run$1(FunSuiteLike.scala:233)
at org.scalatest.SuperEngine.runImpl(Engine.scala:521)
at org.scalatest.FunSuiteLike.run(FunSuiteLike.scala:233)
at org.scalatest.FunSuiteLike.run$(FunSuiteLike.scala:232)
at org.apache.spark.SparkFunSuite.org$scalatest$BeforeAndAfterAll$$super$run(SparkFunSuite.scala:56)
at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:213)
at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
at org.apache.spark.SparkFunSuite.run(SparkFunSuite.scala:56)
at org.scalatest.tools.Framework.org$scalatest$tools$Framework$$runSuite(Framework.scala:314)
at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:507)
at sbt.ForkMain$Run$2.call(ForkMain.java:296)
at sbt.ForkMain$Run$2.call(ForkMain.java:286)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)