Skip to content

test: cover the Scylla connection-setup helpers (DRIVER-1000) - #1083

Draft
nikagra wants to merge 1 commit into
scylladb:scylla-4.xfrom
nikagra:test/driver-1000-connection-helpers
Draft

nikagra wants to merge 1 commit into
scylladb:scylla-4.xfrom
nikagra:test/driver-1000-connection-helpers

Conversation

@nikagra

@nikagra nikagra commented Sep 14, 2026

Copy link
Copy Markdown

Two Scylla-only helpers run while a connection is being brought up, and the 4.x coverage report shows both barely exercised: LwtInfo has no test at all (72% of lines), and RejectionSafeEventExecutor has exactly one, covering only the rejection path (50%).

LwtInfo is the riskier of the two. It parses the LWT bit mask out of the server's SUPPORTED options and echoes it back in STARTUP; get that wrong and the driver silently misclassifies LWT statements, which changes routing.

  • LwtInfoTest: every path that returns null (option absent, null list, list without exactly one entry, null value, wrong prefix, unparsable number), and the STARTUP round trip.
  • The case worth having: the server sends the mask as an unsigned int32. 2147483648, the value Scylla actually sends, must fold to Integer.MIN_VALUE, and isLwt is exercised with that sign-bit mask, where a signed comparison would break. What goes back in STARTUP is then the signed form — 4294967295 is echoed as -1 — which nothing asserted before.
  • RejectionSafeEventExecutorTest: the non-rejecting path, both inEventLoop overloads, and the lifecycle/shutdown delegation surface.

Both classes reach 100% line and branch coverage: 16 missed lines and 5 missed branches closed against baseline run 34559159215.

Verified with mvn clean test -pl core (3985 unit tests green, up from 3968), and by mutation: isLwt rewritten as (flags & mask) > 0, and the STARTUP value written with Integer.toUnsignedString, each passes the old tests and fails the new ones. No integration lane was run; these are pure unit tests with no server dependency.

One of several independent PRs for DRIVER-1000, all off scylla-4.x, not a stack. Siblings: #1082, #1084, #1086.

Refs: https://scylladb.atlassian.net/browse/DRIVER-1000

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

LwtInfo had no test at all and RejectionSafeEventExecutor only its
rejection path, leaving both Scylla-only helpers that run while a
connection comes up largely unexercised.

Covers every branch of loadFromSupportedOptions, including the fold-back
of a mask the server sends as an unsigned int32, and the executor's
delegation surface. Both classes reach 100% line and branch coverage,
closing 16 missed lines and 5 missed branches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nikagra
nikagra force-pushed the test/driver-1000-connection-helpers branch from 1b1afe3 to 77ee789 Compare September 15, 2026 13:54
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.

1 participant