Skip to content

Share Redis fixtures across Lettuce tests - #13692

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
alexeyk/share-lettuce-test-fixtures
Nov 30, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
alexeyk/share-lettuce-test-fixtures

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Shares Redis containers and Lettuce clients across the standalone specs and cluster tests. Each test still opens its own connection and runs the same instrumentation assertions.

Motivation

Starting a container and shutting down a client for every test repeats work across all Lettuce versions and forked suites. Sharing the fixtures cuts repeated startup and shutdown work while keeping each test's connection state isolated.

Additional Notes

  • Standalone tests clear and reseed Redis before each test. The six SHUTDOWN and DEBUG SEGFAULT cases replace the server afterward, and the next test creates a client for the new mapped port.
  • Cluster tests share one container and client. The replica-read test writes a distinct value so it waits for its own write to replicate, then checks the replica's host and port on the span.
  • The single master-replica test keeps its existing fixture. The Ignite fixture reuse in Run up to four JVMs per forked test task #13559 follows a similar approach.
  • Validation covered all 12 regular and forked tasks for Lettuce 5.0, 5.1, 6.0, 6.1, 6.2, and latestDep (8.0.0.BETA1). All 696 test executions passed locally.

CI timing

Each row compares fresh runs of the same affected Lettuce test classes on master and this PR. Times sum JUnit class durations within one Gradle task. Parallel classes can overlap.

Java 8

Gradle suite Master This PR Change
test 2m 58s 2m 03s -31%
forkedTest 4m 35s 3m 03s -33%
lettuce51Test 4m 05s 2m 06s -49%
lettuce51ForkedTest 4m 16s 2m 34s -40%
lettuce60Test 3m 06s 2m 06s -32%
lettuce60ForkedTest 4m 01s 2m 35s -36%
lettuce61Test 3m 09s 1m 58s -38%
lettuce61ForkedTest 4m 03s 2m 42s -33%
lettuce62Test 2m 47s 2m 13s -20%
lettuce62ForkedTest 4m 00s 2m 45s -31%
latestDepTest 3m 43s 1m 51s -50%
latestDepForkedTest 4m 29s 2m 49s -37%

Java 11

Gradle suite Master This PR Change
test 3m 15s 2m 19s -29%
forkedTest 4m 27s 3m 19s -26%
lettuce51Test 3m 53s 2m 22s -39%
lettuce51ForkedTest 4m 17s 2m 50s -34%
lettuce60Test 3m 02s 2m 27s -19%
lettuce60ForkedTest 4m 05s 3m 01s -26%
lettuce61Test 3m 10s 2m 16s -29%
lettuce61ForkedTest 4m 05s 3m 01s -26%
lettuce62Test 3m 15s 2m 30s -23%
lettuce62ForkedTest 4m 18s 3m 01s -30%

The latestDep CI matrix omits Java 11.

Contributor Checklist

Jira ticket: N/A

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added tag: no release notes Changes to exclude from release notes type: refactoring inst: lettuce Lettuce instrumentation tag: ai generated Largely based on code generated by an AI or LLM labels Nov 25, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.83 s 14.76 s [-0.2%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 13.65 s 13.75 s [-1.6%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.73 s 17.45 s [+0.6%; +2.5%] (maybe worse)
startup:petclinic:iast:Agent 17.42 s 17.59 s [-1.8%; -0.2%] (maybe better)
startup:petclinic:profiling:Agent 16.96 s 16.75 s [-5.0%; +7.4%] (unstable)
startup:petclinic:sca:Agent 17.66 s 17.09 s [-0.8%; +7.5%] (no difference)
startup:petclinic:tracing:Agent 16.67 s 16.42 s [-2.8%; +5.8%] (no difference)

Commit: 6bae4991 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review November 25, 2026 21:21
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from a team as code owners November 25, 2026 21:21
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested review from bric3, sarahchen6 and ygree and removed request for a team November 25, 2026 21:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T21:23:48.894655Z 45f6fa8 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-25T21:24:03.166954Z 45f6fa8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The static assessment found that per-test connections, Redis data resets, and server/client replacement after destructive commands preserve isolation when sharing fixtures.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 45f6fa8

@bric3 bric3 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I think a look from IDM would be useful as well.

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

The PR reduces repeated Redis startup and Lettuce shutdown work through shared fixtures while retaining per-test connections and data resets. One issue remains: failed replacement startup after a destructive test can make subsequent tests fail without retrying startup; there were no earlier findings requiring fixes.

Open Bits AI session

🤖 Bits Code Review · Commit ad1d794

@sarahchen6 sarahchen6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement!

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The PR shares Redis containers and Lettuce clients while retaining per-test connections and resetting standalone data. The update fixes the startup recovery issue by starting Redis before each test accesses its URI and deferring replacement until needed; no findings remain open.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 6bae499

@ygree ygree left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor Author

Is reusing the client brings in any significant improvement?

Reusing the client avoids repeated shutdowns. Each shutdown has a configured one-second quiet period. In the 11-test sync spec, the shared fixture went from 11 client shutdowns to 2. Each test still gets a fresh connection.

On the matched Java 17 CI runs, that spec took 25.9s on master and 10.1s on this PR. That measures client and container reuse together. The logs don’t time client shutdown separately.

flowchart TD
    subgraph Before
        A[Create a client for each test] --> B[Run test with a fresh connection]
        B --> C[Shut down client with a one-second quiet period]
    end
    subgraph After
        D[Create a shared client when needed] --> E[Run test with a fresh connection]
        E --> F{Did the test stop Redis or finish the suite?}
        F -->|No| E
        F -->|Yes| G[Shut down the shared client]
        G -->|Another test needs Redis| D
    end
Loading

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-30 21:06:35 UTC ℹ️ Start processing command /merge


2026-11-30 21:06:39 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 58m (p90).


2026-11-30 21:45:18 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 91e2d84 into master Nov 30, 2026
690 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the alexeyk/share-lettuce-test-fixtures branch November 30, 2026 21:45
@github-actions github-actions Bot added this to the 1.70.0 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: lettuce Lettuce instrumentation tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants