Skip to content

CASSANALYTICS144: Split testing pipelines out#198

Merged
jmckenzie-dev merged 18 commits intoapache:trunkfrom
jmckenzie-dev:ca144_split_pipelines
Apr 22, 2026
Merged

CASSANALYTICS144: Split testing pipelines out#198
jmckenzie-dev merged 18 commits intoapache:trunkfrom
jmckenzie-dev:ca144_split_pipelines

Conversation

@jmckenzie-dev
Copy link
Copy Markdown
Contributor

We need to de-parameterize testing, split out to a representative pre-commit smoke test, and ideally randomize our test ordering reproducibly based on the SHA of the commit we're testing. Oh, and probably tune our resource utilization for integration and unit tests.

Comment thread .circleci/config.yml
Comment thread .github/workflows/test.yaml Outdated
# then shard across runners via round-robin on the shuffled order.
CLASSNAMES=$(find . -name '*Test.java' | cut -c 3- | sed 's@/@.@g' | sed 's/.\{5\}$//' \
| python3 -c "import random,sys; lines=sys.stdin.read().splitlines(); random.seed('$GITHUB_SHA'); random.shuffle(lines); print('\n'.join(lines))" \
| awk 'NR % 5 == ${{ matrix.job_index }}')
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.

[minor] can we have matrix.job_total in-place of hardcoded 5 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep - promoted that up.

@skoppu22
Copy link
Copy Markdown
Contributor

LGTM, can you please share Circle CI pipeline link

Patch by Josh McKenzie, reviewed by TBD for CASSANALYTICS-144

Breaks out tests to parameterize based on specific cassandra versions.
Gradle files will be coupled with CassandraVersion.java but both are
commented to indicate their interdependency with one another.

Also adds some convenience configurations in intellij config so you
can select a specific cassandra version to run tests against at runtime
or just choose "test" or "testSequential" to run against all supported
major cassandra versions.
MultipleTokens test classes use assumeThat(>= 4.1) in @BeforeAll to skip
on Cassandra 4.0. When CI runs these individually via --tests, the
skipped @BeforeAll leaves zero discovered tests, causing Gradle to fail
with "No tests found." Move failOnNoMatchingTests(false) out of the
skipContainerTest guard so it applies unconditionally.
@jmckenzie-dev jmckenzie-dev force-pushed the ca144_split_pipelines branch from a3c15e3 to 1f6275a Compare April 21, 2026 16:38
@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

@jmckenzie-dev jmckenzie-dev requested a review from yifan-c April 21, 2026 18:41
@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

There are some CI failures @skoppu22 but best I can tell, they're related to individual tests that are flaky not to the structure of the pipelines. @yifan-c - tapping you for 2nd reviewer role.

@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

Here's latest circle pipeline: link

@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

k; CI looks much cleaner than it has been lately. @yifan-c - waiting on you now.

Comment thread .circleci/config.yml Outdated
INTEGRATION_MAX_PARALLEL_FORKS: 1
INTEGRATION_MAX_HEAP_SIZE: "1500M"
CORE_MAX_PARALLEL_FORKS: 2
INTEGRATION_MAX_PARALLEL_FORKS: 2
Copy link
Copy Markdown
Contributor

@yifan-c yifan-c Apr 21, 2026

Choose a reason for hiding this comment

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

INTEGRATION_MAX_PARALLEL_FORKS has always been 1. Please revert the change. The in-jvm-dtest cannot run in parallel.

If updating to 2 works, I am good with 2.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Happy to revert, but also uncertain why the claim they cannot be run in parallel as they're running and passing in both circle and github. There is some flakiness in both env right now but the test failures look to be pre-existing failures or timeouts afaict.

Either way, I'll drop this to 1, bump the heap to 3072 for all integration, and let's see how it runs w/that combo.

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.

I don't think the original statement is true, we've run integration tests in parallel in the past, not sure if anything changed recently that prevents us from running in parallel

Comment thread .github/workflows/test.yaml Outdated
Comment on lines +137 to +149
config: ['s2.13-c5.0.5', 's2.12-c4.1.4', 's2.12-c4.0.17']
job_index: [0, 1, 2, 3, 4]
job_total: [5]
include:
- config: 's2.13-c5.0.5'
scala: '2.13'
cassandra: '5.0.5'
- config: 's2.12-c4.1.4'
scala: '2.12'
cassandra: '4.1.4'
- config: 's2.12-c4.0.17'
scala: '2.12'
cassandra: '4.0.17'
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.

This is the same as the previous matrix with exclusion. Either one is fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't understand what you mean here. Are you saying that the previous structure here:

      matrix:
        scala: [ '2.12', '2.13' ]
        cassandra: [ '4.0.17', '4.1.4', '5.0.5' ]
        job_index: [ 0, 1, 2, 3, 4 ]
        job_total: [ 5 ]
        exclude:
          - scala: "2.12"
            cassandra: "5.0.5"
          - scala: "2.12"
            cassandra: "4.1.4"
          - scala: "2.13"
            cassandra: "4.0.17"

before this patch is identical? I agree, but I find the include approach to be easier to reason about than the exclude. i.e. easier to reason about just what we're running directly than to think about the entire spectrum of combinations and carving out parts.
wdyt?

Comment thread build.gradle
// - cassandraVersionEnumMap values must match the implemented_versions default
// - cassandraFullVersionMap values must match the supported_versions default
ext.cassandraVersionEnumMap = ["4.0": "FOURZERO", "4.1": "FOURONE", "5.0": "FIVEZERO"]
ext.cassandraFullVersionMap = ["4.0": "4.0.17", "4.1": "4.1.4", "5.0": "5.0.5"]
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.

can you add a comment to reference to scripts/build-dtest-jars.sh, the script that builds the cassandra dtest jars?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ugh. Added comments in all 3 places (build.gradle, build-dtest-jars.sh, CassandraVersion.java to all reference each other. I'll take a note for a follow up JIRA to have a single source of truth for this that we pull from at build time; this is way too brittle.

Comment thread .github/workflows/test.yaml Outdated
@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

@yifan-c - Circle CI green, and the failure in github is the reusable cluster problems I'm tackling on CASSANALYTICS-146. maxParallelForks at 1 seems to have gotten in and out in comparable time to 2 in Circle; we can always create a follow up ticket to see if we can push to parallel at 2 w/3G heap each, or even 3.5g each and leave 1G for system.

We about ready to merge this one?

@jmckenzie-dev
Copy link
Copy Markdown
Contributor Author

@jmckenzie-dev jmckenzie-dev merged commit daa08d4 into apache:trunk Apr 22, 2026
18 of 19 checks passed
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.

4 participants