Repository navigation
Improve CI pipeline stability - #3740
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves CI stability by removing several sources of test flakiness in Lettuce integration tests, primarily by ensuring database flushes complete before tests run, and by waiting/polling for asynchronous side effects (listeners, RediSearch indexing, cluster routing) before asserting.
Changes:
- Replace fire-and-forget
flushall()calls with synchronous flushes in test setup to ensure a clean keyspace. - Make async listener/indexing assertions deterministic by polling with
Wait.until…().waitOrTimeout(). - Stabilize cluster
RANDOMKEYtests by seeding keys across all master partitions instead of only two nodes.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/io/lettuce/core/search/RediSearchAdvancedConceptsIntegrationTests.java | Poll initial RediSearch queries to tolerate brief indexing lag. |
| src/test/java/io/lettuce/core/ReactiveConnectionIntegrationTests.java | Use synchronous flushall() in setup to avoid race with test bodies. |
| src/test/java/io/lettuce/core/protocol/CodecFailureIntegrationTests.java | Make reconnect-event assertion resilient by filtering events per connection and polling. |
| src/test/java/io/lettuce/core/PipeliningIntegrationTests.java | Use synchronous flushall() in setup to avoid race with test bodies. |
| src/test/java/io/lettuce/core/CommandListenerIntegrationTests.java | Replace eager list-size assertions with polling to wait for listener callbacks. |
| src/test/java/io/lettuce/core/cluster/AdvancedClusterReactiveIntegrationTests.java | Seed all master partitions and assert randomkey() returns a seeded key. |
| src/test/java/io/lettuce/core/cluster/AdvancedClusterClientIntegrationTests.java | Seed all master partitions and assert randomkey() returns a seeded key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit b84803d. Configure here.
Collaborator
|
LGTM. will be merging it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Removes flakiness from a set of integration tests that were failing non-deterministically in CI. Test-only changes.
PipeliningIntegrationTests,ReactiveConnectionIntegrationTests,CodecFailureIntegrationTests@BeforeEachranconnection.async().flushall()fire-and-forget, so a test body could start against a keyspace that wasn't yet flushed. Switched to the sync form.CommandListenerIntegrationTestsListener callbacks fire on the Netty I/O thread after the sync caller has already been unblocked by
command.complete(...), so the eagerhasSize(...)assertions ran before the lists were populated. Replaced withWait.untilEquals(...)polling.AdvancedClusterClientIntegrationTests.randomKey,AdvancedClusterReactiveIntegrationTests.randomKeyRANDOMKEYis dispatched to a randomly-picked partition, but the test only seeded two nodes — so a pick on an unseeded node returnednulland failed the assertion. Now seeds every master partition with a slot-targeted key and asserts the result is in the seeded set.CodecFailureIntegrationTests.testCommandsWithCustomCodecRuntimeExceptionreconnects[0] == 1was brittle because theEventBusis JVM-singleton (cross-connection contamination),ConnectionWatchdogpublishes one event per retry (retry inflation), and event delivery is async (race with the assertion). Now filters events by the connection'sepId(resolved viaDelegating.unwrap()to the underlyingEndpoint), polls withWait.untilTrue(>= 1), and disposes the subscription on completion.RediSearchAdvancedConceptsIntegrationTests.testNoStemmingOptionThe first search against a freshly-populated index could race RediSearch's keyspace-notification indexer and observe
count == 0. Wrapped each first-search-after-fresh-index in aWait.untilTrue/untilEqualspoll on the same predicate; subsequent searches keep their direct assertions.Note
Low Risk
Test-only changes that reduce timing-related flakiness by switching to synchronous setup and adding polling around async/eventual-consistency behaviors; low product risk but could mask real regressions if timeouts are too lenient.
Overview
Improves integration test stability by removing race conditions and eventual-consistency assumptions.
Several tests now use synchronous
FLUSHALLin@BeforeEachto ensure a clean keyspace before assertions, andCommandListenerIntegrationTestsreplaces immediate event-count assertions withWait.untilEquals(...)polling to account for listener callbacks running asynchronously.Cluster
randomkey()tests now seed every master partition with a slot-targeted key and assert the returned key is from the seeded set, avoidingnullresults from randomly chosen empty partitions. Codec failure tests filterReconnectAttemptEvents by the connection endpoint id, poll for reconnect delivery, and dispose the event subscription to avoid cross-test/event-bus contamination. RediSearch stemming tests poll initial queries to absorb indexer lag after writes.Reviewed by Cursor Bugbot for commit b84803d. Bugbot is set up for automated code reviews on this repo. Configure here.