Skip to content

Exclude test_rolling_upgrade from integrationTests; add testSmokeBats task - #4280

Draft
dsmiley wants to merge 3 commits into
apache:mainfrom
dsmiley:copilot/disable-rolling-upgrade-test-integration-tests
Draft

dsmiley wants to merge 3 commits into
apache:mainfrom
dsmiley:copilot/disable-rolling-upgrade-test-integration-tests

Conversation

@dsmiley

@dsmiley dsmiley commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

See dsmiley#27

test_rolling_upgrade.bats requires Docker and published images, making it unsuitable for the standard integrationTests run. Since bats does not recurse into subdirectories, moving the file is sufficient to exclude it.

Changes

  • test/smoke/test_rolling_upgrade.bats — moved from test/ into a new test/smoke/ subdirectory; integrationTests (which runs bats test/) will no longer discover it
  • build.gradle — adds a testSmokeBats task (type BatsTask, testDir = 'test/smoke') with the same env-var setup as integrationTests, intended for standalone invocation (e.g. from smokeTestRelease.py when Docker is present)
# Run smoke tests explicitly
./gradlew :solr:packaging:testSmokeBats
# or directly
bats solr/packaging/test/smoke/test_rolling_upgrade.bats

@dsmiley
dsmiley requested review from epugh and janhoy April 13, 2026 02:02
@dsmiley

dsmiley commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

Developed with Copilot Agent.

TODO: update the smoketester python script to call this gradle task. Or maybe simply update that Jenkins job to call it.

@epugh

epugh commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

I am somewhat ambivalent about this... I guess I am worried that by carving this into it's own test infrastructure, that we end up never running it. I worry it will become like some of the Nightly tests, that never get run by us locally and therefore when they do get run they break, which is frustrating, and or no one pays attention to the errors.

Thinking out loud...

  1. How could we make the test faster? It might be interesting to try and understand why it feels slow... Maybe identify some things we need to work on?

  2. What about moving it to run as part of the Docker tests? That way we could test rolling upgrade against a freshly built Docker image which might be useful.

  3. We are moving towards more Docker based testing infrastructure, like for Tika. Maybe we just declare that Docker is required for the iTest?

What do you think the criteria SHOULD be for moving items into testSmokeBats? Maybe having clearer expectations and having more tests moving would help me wrap my head around it. Right now it just feels like we are sending this one test off to bit rot!

environment BATS_LIB_PREFIX: "$nodeProjectDir/node_modules"
}

task testSmokeBats(type: BatsTask) {

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.

how much of the below lines of code could be refactored out so we don't list this code twice, once for iTest and a second time for testSmokeBats?

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.

Yeah I don't like repetition; I suspected it but didn't look. I may try to reduce it.

What I want to see happen (separate issue/PR) is what I said in my dev list email -- this tech becoming a kind of gradle build infra that can be used wherever we want -- not just specifically where it lives now. If we do that, then I would imagine a new gradle task type for BATS for Solr that would have such vars built-in and we wouldn't need to say much to add a new gradle target using it.

@dsmiley

dsmiley commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

A failure here only needs to be caught at release time, so I'm okay with the risk of us collectively not noticing till then.

Even in saying that, I'm implying that absolutely nobody ever reviews the state of our jenkins jobs. While somewhat true, and a freaking crying shame, I think that should be solved independently out of scope of this conversation. @iamsanjay and I are discussing ideas to address that. I don't think we should expect GHA/PR to be our total coverage of tests, albeit certainly the vast majority -- yes.

How could we make the test faster? It might be interesting to try and understand why it feels slow... Maybe identify some things we need to work on?

We'll always have some tests that are not fast so we need to deal with it. Personally I'm not interested in optimizing this specific test further but go for it if you are so inclined.

What about moving it to run as part of the Docker tests? That way we could test rolling upgrade against a freshly built Docker image which might be useful.

Did you see my dev-list thread?: For this rolling upgrade test, Docker isn't the point but is a practical implementation choice.

We are moving towards more Docker based testing infrastructure, like for Tika. Maybe we just declare that Docker is required for the iTest?

Shrug; I'm not moving this out because it uses Docker. I'm moving it out both because it's expensive and because a failure here is very unlikely and it's acceptible to be caught at release time. But it's very important for an eventual failure here to be noticed by us before a release is made. I think "smoke" fits the bill.

I was looking at our smoke tester, and I wonder if much of it could be converted to bats tests. So that also was a factor for me choosing to create a new "testSmokeBats" target & directory, even though it only has one test there now.

@dsmiley

dsmiley commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

Admittedly I did a faux pax. The description is entirely LLM generated; I should have reviewed it; sorry! It over-emphasizes the Docker nature of the test. That isn't the point.

@janhoy

janhoy commented May 20, 2026

Copy link
Copy Markdown
Contributor

I'd prefer perhaps a TestContainers centered JUnit test for the same. Claude can refactor it in a minute... I feel it gives better tools for robustness and it could be flagged as @nightly for frequent runs without dragging down every bats run with it.

@dsmiley

dsmiley commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

I feel it gives better tools for robustness

Can you elaborate?

If we do a JUnit conversion, I'd rather wait for a SolrTestRule & SolrBackend that is Docker backed to exist, as we'll need that for other backwards-compatibility testing anyway. I should have something eventually; some of the infra is WIP.

@janhoy

janhoy commented May 29, 2026

Copy link
Copy Markdown
Contributor

I feel it gives better tools for robustness

Can you elaborate?

Well, you can script retry / wait loops etc in bats, but if we scaffold some test helpers to start/stop solr in docker as part of a JUnit test, then we could piggy back on existing infra for all of this. And we get to run tests in parallel.

If we do a JUnit conversion, I'd rather wait for a SolrTestRule & SolrBackend that is Docker backed to exist, as we'll need that for other backwards-compatibility testing anyway. I should have something eventually; some of the infra is WIP.

Yea, I see lots of movement in test framework base clasess. Don't fully grasp the entire landscape of Rule vs base class etc, but yea, starting Solr in a Testcontainer seems like something that should be a foundational capability..

@janhoy janhoy 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.

To me, this is OK as an intermediate step, perhaps towards a more robust JUnit test for the same. Feel free to fold in and then continue in followup PRs as needs arise.

@epugh

epugh commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

I don't love it. We have more and more tests in our regular ./gradlew test that require Docker for our test containers, so that doesn't seem a good reason to seperate this test out because of that specific item. Our ./gradlew test take a while to run, so the fact that this test is slow doesn't seem like a differentator either.

I wonder if what we really need is:

./gradlew test - Our classic java pure unit and the integration tests + FAST bats tests focused on original CLI testing.
./gradlew systemTest - true system tests like the Selenium tests and the slower .bats tests that have grown to beyond the original cli test plan?

The more categories of tests we define, the less that any outside of ./gradlew test will ever be run. I can't remember the last time I ran the nightly for example.

@janhoy

janhoy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Tests may be fragmented, for sure. But I agree with David that there are types of tests that we can accept being run mainly during the modification of a cetain feature and before each release. If RAT tests were heavy and slow that would be a good candidate. Same with these upgrade tests, they need only prevent that we ship something that is broken. And if we can run such tests weekly or nightly in CI, we also get some feedback without haling each PR run forever.

The fact that noone cares about the failure logs of nightly is a different problem. I wonder if we could give solrbot some LLM credits and have him do test status analysis each Sunday for each of our active branches - a summary that yells loudly, with link to offending commit, when tests consistently fail, when there is a new flaky test, when test execution time sky-rocket etc. It could be well worth the spending of some tokens.

@janhoy

janhoy commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

🤖 BATS is going away: CATS (SOLR-18642, #5323) has replaced it on main, and SOLR-18645 (#5369) removes the .bats files. The rolling upgrade test now lives in solr/docker as RollingUpgradeTest, so this PR looks superseded. Can it be closed?

@epugh

epugh commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

I would think so! I am very excited about having rolling upgrades as a "normal part of testing" solr ;-).

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.

4 participants