Skip to content

fix: rename 3.x driver-core CCM ITs to *Test.java so Surefire discovers them - #982

Merged
dkropachev merged 3 commits into
scylladb:scylla-3.xfrom
nikagra:issue-981-fix-3x-ccm-it-discovery
Aug 3, 2026
Merged

fix: rename 3.x driver-core CCM ITs to *Test.java so Surefire discovers them#982
dkropachev merged 3 commits into
scylladb:scylla-3.xfrom
nikagra:issue-981-fix-3x-ccm-it-discovery

Conversation

@nikagra

@nikagra nikagra commented Jul 30, 2026

Copy link
Copy Markdown

Behavior

driver-core's *IT.java CCM integration tests were silently never executed by CI:

  • driver-core/pom.xml doesn't bind the maven-failsafe-plugin in its own <build><plugins> — it's only declared in the root pluginManagement, and actually bound only inside driver-tests/osgi/*.
  • Maven Surefire's default <includes> (**/Test*.java, **/*Test.java, **/*Tests.java, **/*TestCase.java) never match *IT.java.
  • The -Pshort/-Plong profiles (used by make test-integration-scylla/test-integration-cassandra, i.e. mvn verify -Pshort) only set the TestNG test.groups filter, which only narrows tests within files Surefire already selected by name — it can't rescue files Surefire never picked up in the first place.

Confirmed via mvn help:effective-pom and by decompiling the actual SurefireMojo defaults from the maven-surefire-plugin jar — no override exists anywhere in this repo's POMs for driver-core.

Changes

Renamed the 4 affected classes to match Surefire's default discovery pattern, mirroring the identical fix already applied to DriverConfigReportingCcmITDriverConfigReportingCcmTest in #973:

  • TabletsITTabletsTest
  • ZeroTokenNodesITZeroTokenNodesTest
  • LWTLoadBalancingITLWTLoadBalancingTest
  • SchemaBuilderITSchemaBuilderTest

No pom.xml changes needed — pure git mv + updating each public class declaration.

Now that LWTLoadBalancingTest actually runs, it surfaced a real, previously undetected bug: both test methods built a SimpleStatement with bound values already attached and then passed it to session.prepare(), which throws IllegalArgumentException: A statement to prepare should not have values. This file was added in a single commit and had never executed before, so nobody caught it. Fixed by preparing the value-free statement and binding actual values only on the resulting PreparedStatement, matching what the test already did on the next line.

Follow-up: ccm add also broke on Scylla

Once the rename made ZeroTokenNodesTest actually execute, every "Scylla ITs" CI leg failed uniformly with ccm: error: no such option: -t. Root cause: CCMBridge.add(int, int) unconditionally passed -t <thriftItf> to ccm add, but scylla-ccm's add command has no Thrift option at all — Scylla never had a Thrift interface. Confirmed against scylla-ccm's actual ClusterAddCmd parser (ccmlib/cmds/cluster_cmds.py, master).

Fixed by branching on isScylla and omitting -t/the thrift interface entirely for Scylla clusters. add(int, int) is also reached via add(int n)add(1, n) from MetadataTest, SessionLeakTest, StateListenerTest, RefreshConnectedHostTest, and NodeRefreshDebouncerTest — not just ZeroTokenNodesTest — so this fix covers all of them whenever they run against a Scylla cluster, not only the newly-enabled test.

Review round: making the activated assertions actually assert something

Review raised that renaming these classes made them execute, but their assertions had never been scrutinised — and several could not fail.

The recurring cause is worth calling out, because it bit two of the three classes: PagingOptimizingLoadBalancingPolicy.newQueryPlan returns Statement.getLastHost() ahead of the real query plan, and PagingOptimizingLatencyTracker.update sets that field after every successful BoundStatement execution. Any test that re-executes one BoundStatement instance in a loop is therefore pinned to its first coordinator, so "all executions hit the same node" holds no matter how routing actually behaves.

TabletsTest — two independent false-passes:

  • removeTableMappings(KEYSPACE_NAME) passed mixed-case "tabletsTest", but TabletMap keys arrive lowercased from the server and are matched with an exact equals(), so the "empty out tablets information" step silently cleared nothing and an iteration could be satisfied by state learned in a previous one. Lowercased, as the three sibling call sites already did.
  • executeOnAllHostsAndReturnIfResultHasTabletsInfo pins the statement via setHost() and never clears it, so checkIfRoutedProperly re-executed a pinned statement and nodes.size() <= REPLICATION_FACTOR could not fail. The pin is now cleared before the routing check, and checkIfRoutedProperly also clears setLastHost(null) per iteration to defeat the paging pin described above.

LWTLoadBalancingTest — could not distinguish PRESERVE_REPLICA_ORDER from RANDOM:

  • The framework's default keyspace is hardcoded to RF=1 (CCMTestsSupport.initTestKeyspace formats CREATE_KEYSPACE_SIMPLE_FORMAT with a literal 1, regardless of @CCMConfig(numberOfNodes = 3)), so "the first replica" was trivially unique. Now overrides initTestKeyspace() to create an RF=3 keyspace, following SingleTokenIntegrationTest's template — RF=3 so SERIAL reads get a 2-of-3 Paxos quorum rather than 2-of-2. Tablets are disabled on Scylla, as in the other replica-placement tests, because an unlearned tablet map yields an empty replica list and drops the LWT plan back to the child policy.
  • RF alone does not fix it: both tests re-executed one BoundStatement, so hasSize(1) was guaranteed by the paging optimisation. Coordinator collection now binds a fresh statement per execution.
  • Added should_spread_non_serial_select_across_replicas as a control — same statement, table and policy, only a non-serial CL — asserting the coordinator does vary.

ZeroTokenNodesTest — asserted on a HashSet with the order-sensitive containsExactly; HashSet iteration order is hash-derived, so this was a latent flake. Switched to containsOnly (AssertJ 1.7.1, which this module pins, has no containsExactlyInAnyOrder; for a Set it's equivalent, and it is what the rest of the file already uses).

CCMBridgeisScylla was derived from the global scylla.version property rather than the constructor's scyllaVersion, unlike the sibling isDSE = dseVersion != null one line above. Now instance-derived. Behaviour-neutral today (Builder.scylla already defaults to the global, withScylla() has no callers, and every bridge actually built takes build()'s !versionConfigured branch where scyllaVersion is the global) — a footgun removal, not a live bug fix.

Scope: CCMBridge flavor resolution moved to #983

Review of this PR went on to find that CCMBridge resolves the server flavor from global system properties throughout, not just in isScyllabuildCreateCommand ignores the Scylla flag and emits -v 3.0.8, SCYLLA_PRODUCT derives from the global scylla.version, and withSSL()/withAuth() pick the JKS-vs-PEM yaml at builder-configuration time.

Fixes for all three were written and live-verified on this branch, then pulled back out: they're a refactor of the CCM test harness, not part of unblocking the tests, and none of it is reachable from CI (the IT legs run mvn verify -Pshort, and no enabled short-group test configures a version while creating a cluster). Tracked as #983, with the full analysis and the two remaining CodeRabbit findings recorded there, and a follow-up PR carrying the commits verbatim. Sibling to #800, which is the same bug class in 4.x.

This PR is now just the rename, the ccm add fix the rename made necessary, and the assertion fixes above.

Not addressed: rewriting the LWT tests around a conditional statement

CodeRabbit also asked for LWTLoadBalancingTest to use a conditional INSERT/UPDATE/DELETE with setSerialConsistencyLevel, on the grounds that TokenAwarePolicy "does not use getSerialConsistencyLevel() for routing". That premise doesn't apply to these tests: they don't set the serial consistency level. They set the normal level to LOCAL_SERIAL/SERIAL, and TokenAwarePolicy.getRequestRouting (TokenAwarePolicy.java:476-488) returns the LWT routing method when statement.isLWT() or when the normal level isSerial(). The second branch is exactly what is under test, which is why the tests assert isLWT() is false. The level survives prepare()bind(): AbstractSession.prepareAsync copies it onto the PreparedStatement (AbstractSession.java:128-131) and the BoundStatement constructor copies it back off (BoundStatement.java:89-90).

The suggested rewrite would exercise the isLWT() branch instead and drop coverage of the serial-level branch. Covering isLWT() as well would be a reasonable addition, but it belongs to a feature this PR didn't enable — happy to open it as a follow-up.

Testing

  • mvn -pl driver-core -am compile test-compile — clean compile.
  • Confirmed the discovery gap is closed: mvn -pl driver-core test -Dtest=<ClassName> -Dtest.groups=short now actually attempts these classes (previously Tests run: 0).
  • Live-verified all enabled tests against ScyllaDB 2026.1.0:
    • TabletsTest: 3/3 pass — now with routing genuinely exercised
    • ZeroTokenNodesTest: 7/7 pass
    • LWTLoadBalancingTest: 3/3 pass (2 pre-existing + the new non-serial control)
    • SchemaBuilderTest: 0 tests run — all 6 methods are pre-existing enabled = false, unrelated to this change.
  • Falsification-checked the newly load-bearing assertions rather than just observing green:
    • With a reused BoundStatement, the non-serial control collapses to 1 coordinator — identical to the serial tests, i.e. indistinguishable.
    • With REPLICATION_FACTOR dropped back to 1, the control fails outright (1 coordinator), confirming the RF bump is what makes the two hasSize(1) assertions meaningful.
  • CI: this exact head passed all 10 checks, including all four IT legs (Scylla ITs LATEST / LTS-LATEST / LTS-PRIOR and Cassandra ITs 3-LATEST). An earlier attempt on an intermediate head failed once on ShardAwarenessTest.correctShardInTracingTest, a pre-existing flake unrelated to this change.

Fixes #981.

🤖 Generated with Claude Code

…rs them

driver-core has no Failsafe plugin binding (only bound in driver-tests/osgi/*),
and Surefire's default includes never match *IT.java, so these CCM integration
tests were silently never executed by `mvn verify -Pshort`/`-Plong`. Renaming to
*Test.java matches Surefire's default discovery pattern, mirroring the fix
already applied to DriverConfigReportingCcmIT in scylladb#973.

Renamed: TabletsIT, ZeroTokenNodesIT, LWTLoadBalancingIT, SchemaBuilderIT.

Now that LWTLoadBalancingTest actually runs, it surfaced a real (previously
undetected) bug: both test methods constructed a SimpleStatement with bound
values and then passed it to session.prepare(), which rejects statements
carrying values. Fixed by preparing the value-free statement and binding
values only on the resulting PreparedStatement, as the tests already intended.

All classes verified live against ScyllaDB 2026.1.0: Tablets (3), ZeroTokenNodes
(7), and LWTLoadBalancing (2) tests pass. SchemaBuilderTest's 6 methods remain
pre-existing enabled=false, unrelated to this fix.

Fixes scylladb#981.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 905f7146-0bed-411a-8662-50167f2ee461

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CCMBridge resolves distribution versions and selects cluster-specific environments. It builds separate commands and encryption settings for Scylla, Cassandra, and DSE clusters. Integration tests now use *Test names for discovery. Tablet and zero-token tests clear routing state and avoid order-sensitive assertions. LWTLoadBalancingTest verifies coordinator selection for serial and non-serial queries. CCMBridgeCreateCommandTest validates command and environment generation.

Sequence Diagram(s)

sequenceDiagram
  participant LWTLoadBalancingTest
  participant Cluster
  participant Replica
  LWTLoadBalancingTest->>Cluster: Execute fresh bound SELECT
  Cluster->>Replica: Resolve coordinator
  Replica-->>LWTLoadBalancingTest: Return queried host
  LWTLoadBalancingTest->>LWTLoadBalancingTest: Check coordinator results
Loading

Suggested labels: P1, area/Driver_-_java-driver-3.x

Suggested reviewers: sylwiaszunejko

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the test renames, related fixes, scope, and validation results.
Linked Issues check ✅ Passed The description explicitly links the changes to issue #981 and explains the related follow-up for #983.
Out of Scope Changes check ✅ Passed The additional fixes and tests directly support executing and validating the renamed CCM integration tests.
Title check ✅ Passed The title clearly identifies the test renames and explains that the change enables Surefire discovery.

Comment @coderabbitai help to get the list of available commands.

CCMBridge.add(int, int) unconditionally included `-t <thriftItf>` in the
`ccm add` command, but scylla-ccm's `add` command has no Thrift option at
all (Scylla never had a Thrift interface) -- passing it makes the whole
command fail with "ccm: error: no such option: -t". Confirmed against
scylladb/scylla-ccm's actual ClusterAddCmd parser (ccmlib/cmds/cluster_cmds.py,
master).

ZeroTokenNodesTest is the only caller of this method, and it never ran
before the scylladb#981 rename fix, so this was never caught. All three "Scylla
ITs" CI matrix legs on scylladb#982 failed with the identical error once the
rename made the test actually execute.

Verified locally against a venv with the real `scylla-ccm` (master, same
as CI's `make install-scylla-ccm`) installed: all 7 ZeroTokenNodesTest
methods pass, plus a full regression of the other 3 renamed classes (12/12).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nikagra
nikagra marked this pull request as ready for review July 30, 2026 21:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Around line 739-751: Update the isScylla initialization in CCMBridge to derive
from the instance scyllaVersion value, using whether scyllaVersion is non-null
rather than the global Scylla property. Preserve the existing Scylla command
options in the add-node branch and ensure withScylla(true).withVersion(...)
selects that branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 72af2586-e8f0-4e42-8b3b-5f39b2a5e6bb

📥 Commits

Reviewing files that changed from the base of the PR and between 74e30fa and 1119088.

📒 Files selected for processing (5)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
  • driver-core/src/test/java/com/datastax/driver/core/TabletsTest.java
  • driver-core/src/test/java/com/datastax/driver/core/ZeroTokenNodesTest.java
  • driver-core/src/test/java/com/datastax/driver/core/policies/LWTLoadBalancingTest.java
  • driver-core/src/test/java/com/datastax/driver/core/schemabuilder/SchemaBuilderTest.java

Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
Comment thread driver-core/src/test/java/com/datastax/driver/core/TabletsTest.java
Review follow-up on scylladb#982. Renaming these classes made them execute for the
first time, but several of their assertions could not fail. Each fix below
was verified live against ScyllaDB 2026.1.0.

TabletsTest, two independent false-passes:

  - `removeTableMappings(KEYSPACE_NAME)` passed the mixed-case "tabletsTest"
    while TabletMap keys arrive lowercased from the server and are matched
    with an exact equals(), so the "empty out tablets information" step
    silently cleared nothing and an iteration could be satisfied by state
    learned in a previous one. Lowercased, as the three sibling call sites
    already do.

  - `executeOnAllHostsAndReturnIfResultHasTabletsInfo` pins the statement
    via setHost() and never clears it, so checkIfRoutedProperly re-executed
    a pinned statement and always observed exactly one coordinator --
    `nodes.size() <= REPLICATION_FACTOR` could not fail. The pin is now
    cleared before the routing check.

  - Additionally, checkIfRoutedProperly now clears Statement.getLastHost()
    per iteration. PagingOptimizingLoadBalancingPolicy returns that host
    ahead of the real query plan and PagingOptimizingLatencyTracker sets it
    after every successful BoundStatement execution, which pinned the loop
    to its first coordinator for the bound-statement half of the matrix.

LWTLoadBalancingTest could not distinguish PRESERVE_REPLICA_ORDER from
RANDOM, for two reasons:

  - The framework's default keyspace is hardcoded to RF=1, so "the first
    replica" was trivially unique and hasSize(1) held under REGULAR routing
    too. initTestKeyspace() is now overridden to create an RF=3 keyspace
    (tablets disabled on Scylla, as elsewhere for replica-placement tests),
    following SingleTokenIntegrationTest's template.

  - Both tests re-executed one BoundStatement instance, so the paging
    optimisation described above pinned the coordinator after the first
    query -- hasSize(1) was guaranteed by that, not by the LWT path.
    Coordinator collection now binds a fresh statement per execution.

  - Added should_spread_non_serial_select_across_replicas as the control:
    same statement, same table, same policy, non-serial consistency level,
    asserting the coordinator does vary. Verified that it fails (1
    coordinator) if REPLICATION_FACTOR is dropped back to 1, so the two
    hasSize(1) assertions are now load-bearing.

ZeroTokenNodesTest asserted on a HashSet with containsExactly, which is
order-sensitive; HashSet iteration order is hash-derived, so this was a
latent flake. Switched to containsOnly, already used everywhere else in the
file (AssertJ 1.7.1, which this module pins, has no
containsExactlyInAnyOrder; for a Set containsOnly is equivalent).

CCMBridge derived the instance's `isScylla` from the global scylla.version
property instead of the constructor's scyllaVersion, unlike the sibling
`isDSE = dseVersion != null` one line above. Now derived from the instance.
Behaviour-neutral today -- Builder.scylla already defaults to the global,
withScylla() has no callers, and every bridge that is actually built takes
build()'s !versionConfigured branch where scyllaVersion *is* the global --
so this removes a footgun rather than fixing a live bug.

Verified: TabletsTest 3/3, ZeroTokenNodesTest 7/7, LWTLoadBalancingTest 3/3
against ScyllaDB 2026.1.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
driver-core/src/test/java/com/datastax/driver/core/policies/LWTLoadBalancingTest.java (1)

109-113: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use a conditional statement for serial-consistency routing tests.

TokenAwarePolicy checks the normal consistency level or Statement.isLWT(). It does not use getSerialConsistencyLevel() for routing. Replace these SELECT statements with conditional INSERT, UPDATE, or DELETE statements. Set ConsistencyLevel.ONE as the normal level and set LOCAL_SERIAL or SERIAL with setSerialConsistencyLevel. Assert both consistency properties.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@driver-core/src/test/java/com/datastax/driver/core/policies/LWTLoadBalancingTest.java`
around lines 109 - 113, Update the serial-consistency routing tests around
simpleSelect and preparedSelect to use a conditional INSERT, UPDATE, or DELETE
rather than a SELECT, so the statement is recognized as an LWT. Set the normal
consistency to ConsistencyLevel.ONE, set the serial level through
setSerialConsistencyLevel using LOCAL_SERIAL or SERIAL as appropriate, and
assert both consistency properties before exercising TokenAwarePolicy routing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Line 433: Update CCMBridge cluster creation to use the resolved scyllaVersion
consistently, including buildCreateCommand(), add(), and Scylla-specific
configuration, so withScylla(true).withVersion(...) emits the Scylla command and
does not depend solely on GLOBAL_SCYLLA_VERSION_NUMBER. Add a regression test
covering explicit Scylla mode with a configured version.

---

Outside diff comments:
In
`@driver-core/src/test/java/com/datastax/driver/core/policies/LWTLoadBalancingTest.java`:
- Around line 109-113: Update the serial-consistency routing tests around
simpleSelect and preparedSelect to use a conditional INSERT, UPDATE, or DELETE
rather than a SELECT, so the statement is recognized as an LWT. Set the normal
consistency to ConsistencyLevel.ONE, set the serial level through
setSerialConsistencyLevel using LOCAL_SERIAL or SERIAL as appropriate, and
assert both consistency properties before exercising TokenAwarePolicy routing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa5db620-a44f-4cfe-aa0c-729e4f931435

📥 Commits

Reviewing files that changed from the base of the PR and between 1119088 and 5b3588e.

📒 Files selected for processing (4)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
  • driver-core/src/test/java/com/datastax/driver/core/TabletsTest.java
  • driver-core/src/test/java/com/datastax/driver/core/ZeroTokenNodesTest.java
  • driver-core/src/test/java/com/datastax/driver/core/policies/LWTLoadBalancingTest.java

Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Around line 1397-1403: Update CCMBridge execution-environment construction to
use ResolvedVersions rather than the immutable global ENVIRONMENT_MAP, setting
SCYLLA_PRODUCT to enterprise when Scylla is enabled with an explicit
year-prefixed version while preserving OSS behavior otherwise. Add a regression
test covering withScylla(true).withVersion(VersionNumber.parse("2026.1.0")) and
assert the execution environment contains the enterprise product setting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d6baeeff-a1f7-4b60-9336-3b7de1230c34

📥 Commits

Reviewing files that changed from the base of the PR and between 5b3588e and 099a169.

📒 Files selected for processing (2)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridgeCreateCommandTest.java

Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java (1)

1232-1269: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Resolve TLS configuration from ResolvedVersions.

Line 1267 now supports an explicitly configured Scylla cluster when global scylla.version is absent. However, withSSL() and withAuth() select Cassandra JKS properties from GLOBAL_SCYLLA_VERSION_NUMBER before resolveVersions() runs. The resulting Scylla cluster receives keystore and truststore settings instead of Scylla certificate, keyfile, and PEM truststore settings.

Record the SSL and authentication options in the builder. Apply the flavor-specific configuration after resolving versions. Add coverage for withScylla(true).withVersion(...).withSSL().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java` around
lines 1232 - 1269, Update the builder’s withSSL() and withAuth() flow to record
the requested options rather than selecting properties from
GLOBAL_SCYLLA_VERSION_NUMBER before resolution. After resolveVersions()
determines the active flavor, apply the corresponding Cassandra/DSE or Scylla
keystore, certificate, keyfile, and truststore settings using ResolvedVersions;
add coverage for withScylla(true).withVersion(...).withSSL() to verify PEM-based
Scylla TLS configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Around line 258-260: Remove SCYLLA_PRODUCT from envMap before constructing
BASE_ENVIRONMENT_MAP, ensuring inherited process values cannot reach explicit
OSS environments through buildEnvironmentMap. Preserve withScyllaEnterprise as
the only path that adds SCYLLA_PRODUCT for resolved Enterprise versions.

---

Outside diff comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Around line 1232-1269: Update the builder’s withSSL() and withAuth() flow to
record the requested options rather than selecting properties from
GLOBAL_SCYLLA_VERSION_NUMBER before resolution. After resolveVersions()
determines the active flavor, apply the corresponding Cassandra/DSE or Scylla
keystore, certificate, keyfile, and truststore settings using ResolvedVersions;
add coverage for withScylla(true).withVersion(...).withSSL() to verify PEM-based
Scylla TLS configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a1b5b70b-6582-4c58-9681-b04f09d77f90

📥 Commits

Reviewing files that changed from the base of the PR and between 099a169 and 9f34037.

📒 Files selected for processing (2)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridgeCreateCommandTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridgeCreateCommandTest.java

Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java Outdated
@nikagra

nikagra commented Jul 31, 2026

Copy link
Copy Markdown
Author

The two outside-diff findings can't be replied to inline, so answering both here. Detail is in the PR description under "Review round 4".

Client encryption resolved from ResolvedVersions — fixed in 58bf916fc6. withSSL()/withAuth() now only record the request; buildClientEncryptionOptions(ResolvedVersions) derives the JKS-vs-PEM yaml at build time. Builder.equals/hashCode had to grow ssl/auth as a result, since CCMCache keys cached clusters on the builder. Live-verified: SSLEncryptionTest + SSLAuthenticatedEncryptionTest 9/9 against Scylla 2026.1.0.

Conditional statement for the LWT routing tests — not applying this one. The premise is that TokenAwarePolicy ignores serial consistency for routing, but these tests don't set the serial level; they set the normal level to LOCAL_SERIAL/SERIAL, and getRequestRouting (TokenAwarePolicy.java:476-488) takes the LWT path when isLWT() or the normal level isSerial(). That second branch is what's under test — hence the explicit assertThat(simpleSelect.isLWT()).isFalse(). The rewrite would test the isLWT() branch instead and drop coverage of the serial-level one. Adding isLWT() coverage would be fine as a follow-up, but it belongs to a feature this PR didn't enable.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java`:
- Around line 260-269: Update the initialization around ENVIRONMENT_MAP and
BASE_ENVIRONMENT_MAP so inherited SCYLLA_PRODUCT is removed from globalEnvMap
for numeric OSS versions, pure Cassandra runs, and unset versions, while
preserving it only when the raw scylla.version is an unparsable branch
specification; ensure the globalScyllaEnterprise path continues to apply
withScyllaEnterprise as intended.
- Around line 1072-1073: Update the version configuration flow around
CCMBridge’s dse and scylla flavor state so every explicit Cassandra version is
marked with withScylla(false), preventing GLOBAL_SCYLLA_VERSION_NUMBER from
classifying it as Scylla; alternatively, add equivalent explicit flavor handling
in CCMTestsSupport and RecommissionedNodeTest. Ensure resolveVersions() and
buildCreateCommand() receive the correct Cassandra flavor for those versions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 36ef99b3-f691-47af-ae74-84a91a4d79c5

📥 Commits

Reviewing files that changed from the base of the PR and between 9f34037 and 58bf916.

📒 Files selected for processing (2)
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
  • driver-core/src/test/java/com/datastax/driver/core/CCMBridgeCreateCommandTest.java

Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java Outdated
Comment thread driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java
@nikagra

nikagra commented Jul 31, 2026

Copy link
Copy Markdown
Author

Restructured this PR to keep it to the point of #981.

Review had grown it to 649/205, with ~60% being CCMBridge flavor-resolution rework that is unreachable from CI — each round found the next adjacent read of global state in a class #981 never asked about. Those three commits now live in #984 (verbatim, still CI-green), tracked by #983 alongside the two remaining CodeRabbit findings. #983 is the 3.x sibling of #800.

What is left here is 245/136 — the rename, the ccm add -t fix the rename made necessary, and the assertion fixes. CCMBridge is down to a 46-line delta. This is the same tree that already passed all 10 checks including the four IT legs, so no re-verification was needed.

@dkropachev your three threads on TabletsTest, LWTLoadBalancingTest and ZeroTokenNodesTest are now essentially the whole PR — they were addressed in 5b3588ebe0 and are still open, so a look when you have a moment would be appreciated.

@nikagra

nikagra commented Jul 31, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dkropachev
dkropachev merged commit 301b879 into scylladb:scylla-3.x Aug 3, 2026
27 checks passed
dkropachev pushed a commit that referenced this pull request Aug 3, 2026
CCMBridge.add(int, int) unconditionally included `-t <thriftItf>` in the
`ccm add` command, but scylla-ccm's `add` command has no Thrift option at
all (Scylla never had a Thrift interface) -- passing it makes the whole
command fail with "ccm: error: no such option: -t". Confirmed against
scylladb/scylla-ccm's actual ClusterAddCmd parser (ccmlib/cmds/cluster_cmds.py,
master).

ZeroTokenNodesTest is the only caller of this method, and it never ran
before the #981 rename fix, so this was never caught. All three "Scylla
ITs" CI matrix legs on #982 failed with the identical error once the
rename made the test actually execute.

Verified locally against a venv with the real `scylla-ccm` (master, same
as CI's `make install-scylla-ccm`) installed: all 7 ZeroTokenNodesTest
methods pass, plus a full regression of the other 3 renamed classes (12/12).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants