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

[fix] Ensure Kafka broker is started before running integration tests #5148

Closed
yurishkuro opened this issue Jan 28, 2024 · 3 comments · Fixed by #5154
Closed

[fix] Ensure Kafka broker is started before running integration tests #5148

yurishkuro opened this issue Jan 28, 2024 · 3 comments · Fixed by #5154
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

Kafka integration tests started failing frequently. I suspect our scripts/kafka-integration-test.sh script is not waiting until Kafka is properly started. We need to find a more reliable check.

There are a bunch of scripts available in the container:

docker run -it --rm bitnami/kafka:3.6.0 /bin/sh
$ ls -lF /opt/bitnami/kafka/bin/

We can probably use one of them to more reliably check for running server, e.g. kafka-topics.sh or kafka-broker-api-versions.sh, or even read & write a test message via kafka-console-producer.sh and kafka-console-consumer.sh.

Some documentation on how to run the container is available from bitnami: https://github.com/bitnami/containers/tree/main/bitnami/kafka#how-to-use-this-image

@yurishkuro yurishkuro added help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels Jan 28, 2024
@7h3-3mp7y-m4n
Copy link

can I take this issue?

@yurishkuro
Copy link
Member Author

Feel free

@7h3-3mp7y-m4n
Copy link

Okay @yurishkuro :)

yurishkuro pushed a commit that referenced this issue Jan 29, 2024
## Which problem is this PR solving?
Resolves #5148

## Description of the changes
- The previous approach used ```nc``` to check the availability of the
```Kafka port```, which was not reliable, especially when the Kafka
container was started asynchronously. The updated script now ensures a
more reliable check for Kafka readiness by attempting to list topics
using ```kafka-topics.sh``` within a loop. This modification ensures
that the script waits until Kafka is fully initialized before proceeding
with integration tests.

## How was this change tested?
- This modification ensures that the script waits until Kafka is fully
initialized before proceeding with integration tests.
- Ran ```bash scripts/kafka-integration-test.sh -k``` from the project
root.

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants