Skip to content

Use unique store name in DicomIOReadIT to prevent 409 Conflict across concurrent runs - #41067

Draft
damccorm wants to merge 1 commit into
masterfrom
fix/dicom-io-read-it-store-name
Draft

damccorm wants to merge 1 commit into
masterfrom
fix/dicom-io-read-it-store-name

Conversation

@damccorm

@damccorm damccorm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a flake in DicomIOReadIT (PreCommit Java GCP IO Direct run https://github.com/apache/beam/actions/runs/42336715354/job/128295165204):

com.google.api.client.googleapis.json.GoogleJsonResponseException: 409 Conflict
POST https://healthcare.googleapis.com/v1/projects/apache-beam-testing/locations/us-central1/datasets/apache-beam-integration-testing/dicomStores?dicomStoreId=foo
{
  "code": 409,
  "message": "already exists",
  "status": "ALREADY_EXISTS"
}
    at org.apache.beam.sdk.io.gcp.healthcare.HttpHealthcareApiClient.createDicomStore(HttpHealthcareApiClient.java:270)
    at org.apache.beam.sdk.io.gcp.healthcare.HttpHealthcareApiClient.createDicomStore(HttpHealthcareApiClient.java:225)
    at org.apache.beam.sdk.io.gcp.healthcare.DicomIOReadIT.setup(DicomIOReadIT.java:55)

Root Cause

Unlike all other Healthcare integration tests (HL7v2IOReadIT, FhirIOReadIT, etc.), DicomIOReadIT hardcoded storeName = "foo", causing concurrent test runs (or runs after a prior aborted test) to collide on dicomStores?dicomStoreId=foo with 409 Conflict: already exists.

Changes

  • Generate a unique storeName ("DICOM_store_" + System.currentTimeMillis() + "_" + new SecureRandom().nextInt(32) + "_read_it") in DicomIOReadIT.setup(), matching HL7v2IOReadIT and FhirIOReadIT.

Verification

@damccorm

damccorm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@github-actions github-actions Bot added java io gcp size/xs XS: <10 lines changed labels Nov 7, 2026

@github-actions github-actions Bot 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.

📋 Review Summary

This PR resolves a 409 Conflict test flake in DicomIOReadIT by replacing the hardcoded storeName ("foo") with a dynamically generated unique name in setup(). The change is clean, minimal, and consistent with existing healthcare integration tests like HL7v2IOReadIT.

🔍 General Feedback

  • The store name generation logic matches the pattern established across other GCP Healthcare IO integration tests and ensures test isolation across concurrent runs.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gcp io java size/xs XS: <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant