Skip to content

Spring Batch 6.0: cannot run a test which chains several jobs #5162

@wikisamuel

Description

@wikisamuel

Bug description
I cannot run an integration test which launches several jobs anymore. I was trying to do it without using any deprecated class and failed to find a way.

This appears to be a regression / breaking behavior introduced in Spring Batch 6.0.

Environment
Java 25. Spring Boot Starter Parent 4.0.0.

Steps to reproduce
From the minimal complete verifiable example bellow, run mvn install.

org.springframework.batch.core.launch.JobInstanceAlreadyExistsException: Cannot start a job instance that already exists with name=job1 and parameters={{run.id=1765550710102, uuid=0d95d967-a1dd-4ebf-8534-1f81e1f8141c}}

Expected behavior
The test from the minimal complete verifiable example should pass.

Minimal Complete Reproducible example
minimal complete verifiable example that reproduces the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions