8000 ingest: fix flaky TestPartitionReader_ConsumeAtStartup test after franz-go update by dimitarvdimitrov · Pull Request #11527 · grafana/mimir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ingest: fix flaky TestPartitionReader_ConsumeAtStartup test after franz-go update #11527

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

Merged

Conversation

dimitarvdimitrov
Copy link
Contributor
@dimitarvdimitrov dimitarvdimitrov commented May 26, 2025

Fix TestPartitionReader_ConsumeAtStartup test that was failing due to changes in franz-go's retry behavior. After the franz-go update (#11467, fac21aa), EOF errors on the first read are no longer retried. This PR is similar to #11467.

The test mock now returns proper Kafka error responses (NotLeaderForPartition) instead of raw errors to ensure franz-go will retry as expected. Also improved the coordination between context cancellation and mock responses using atomic boolean to make subsequent requests fail faster.

What this PR does

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

Fix TestPartitionReader_ConsumeAtStartup test that was failing due to changes
in franz-go's retry behavior. After the franz-go update (fac21aa), EOF
errors on the first read are no longer retried.

The test mock now returns proper Kafka error responses (NotLeaderForPartition)
instead of raw errors to ensure franz-go will retry as expected. Also improved
the coordination between context cancellation and mock responses using atomic
boolean to make subsequent requests fail faster.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dimitarvdimitrov dimitarvdimitrov requested a review from a team as a code owner May 26, 2025 06:54
@dimitarvdimitrov dimitarvdimitrov changed the title ingest-storage: fix flaky TestPartitionReader test after franz-go update ingest-storage: fix flaky TestPartitionReader_ConsumeAtStartup test after franz-go update May 26, 2025
@dimitarvdimitrov dimitarvdimitrov changed the title ingest-storage: fix flaky TestPartitionReader_ConsumeAtStartup test after franz-go update ingest: fix flaky TestPartitionReader_ConsumeAtStartup test after franz-go update May 26, 2025
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
@dimitarvdimitrov dimitarvdimitrov merged commit 22e7cf4 into main May 27, 2025
30 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/ingest/fix-reader-test-flakiness-franz-go-eof branch May 27, 2025 21:24
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

Successfully merging this pull request may close these issues.

2 participants
0