manub / scalatest-embedded-kafka

A library that provides an in-memory Kafka instance to run your tests against.
MIT License
294 stars 87 forks source link

EmbeddedKafka.start() -> Is throwing error and won't start #162

Closed martyphee closed 5 years ago

martyphee commented 5 years ago

I was trying to move from the 1.x to 2.x embedded kafka and getting the errors below.

build.sbt

"com.typesafe.akka" %% "akka-stream-kafka" % "1.0-M1",
"org.apache.kafka" % "kafka-clients" % "2.1.+",
"org.apache.kafka" % "kafka-streams" % "2.1.+",

"net.manub" %% "scalatest-embedded-kafka" % "2.0.0" % "test"

Log messages

dt=2018-12-04T17:03:33.137Z level=ERROR thread=ScalaTest-run logger=BrokerMetadataCheckpoint Failed to read meta.properties file under dir /var/folders/cd/bgpl92d561b1xfmft4kfltn00000gn/T/kafka-logs7296107911035011004.tmp/meta.properties due to /var/folders/cd/bgpl92d561b1xfmft4kfltn00000gn/T/kafka-logs7296107911035011004.tmp/meta.properties
dt=2018-12-04T17:03:33.141Z level=ERROR thread=ScalaTest-run logger=KafkaServer Fail to read meta.properties under log directory /var/folders/cd/bgpl92d561b1xfmft4kfltn00000gn/T/kafka-logs7296107911035011004.tmp
java.nio.file.NoSuchFileException: /var/folders/cd/bgpl92d561b1xfmft4kfltn00000gn/T/kafka-logs7296107911035011004.tmp/meta.properties
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
martyphee commented 5 years ago

Resolved. I had to find the correct dependencies for it to work properly.

nikitapecasa commented 5 years ago

@martyphee Did you mean to use 2.0.1 for kafka-streams-scala and the like? I'm having the same error with 2.1.0 kafka-streams-scala and scalatest-embedded-kafka 2.0.0

thiloplanz commented 5 years ago

I had the same problem, I had tried to use "net.manub" %% "scalatest-embedded-kafka" % "2.0.0" % Test with "org.apache.kafka" % "kafka-clients" % "2.1.0".

Matching the versions exactly resolved the issue.