Open seglo opened 5 years ago
Thank you for this suggestion.
The resolution of config doesn't allow us to put an application.conf
to overwrite other settings in Alpakka Kafka. I've however added some text to the documentation about stop-timeout
: https://github.com/akka/alpakka-kafka/blob/master/docs/src/main/paradox/testing.md#testing-from-java-code
@ennru Right, I thought that might be a problem.
Those docs are a big improvement! But I think it's still a little vague about the two suggestions I made in this issue. I suspect most users developing new integration tests a la Alpakka Kafka tests style will run into these exact two issues every time, because there's no inheritance of configuration that works. Do you mind if I could write a PR to include more details in the testing section of the docs?
Configuration can be inherited on config level:
MyConsumerConfigInTests: ${akka.kafka.consumer} {
stop-timeout = 2s
}
But please, go ahead and suggest improvements to the docs.
Versions used
Akka version: 2.5.20 Alpakka Kafka version: 1.0.1
Expected Behavior
Using Alpakka Kafka Testkit with defaults should run a simple integration test.
Actual Behavior
Several Akka Testkit and Alpakka Kafka Testkit settings are required to run relatively simple integration tests. I've noticed that the following configuration is necessary to run most tests out of the box (this can be found in
/tests/src/test/resources/application.conf
).For example, running
akka.kafka.scaladsl.IntegrationSpec
, "produce to plainSink and consume from plainSource". Whenakka.test.single-expect-default
is not defined at something greater than than the default of 3s I get the following error.When
akka.kafka.consumer.stop-timeout
is not set to something less than 5 seconds I regularly get the following exception.Notes
I realize such timing issues can have different results depending on an invidiual machine's resources, but given this configuration is set by default for the Alpakka Kafka tests, and that it's easy to recreate the same errors without the config in a sample project I think it might make sense to include these defaults to users using the testkit.
I suggest including this default config when users run tests using the Alpakka Kafka Testkit, or to highlight this config in the documentation.