Skip to content

Fix a race condition with testCreateStudyWithErrorDuringCaseImport wich fail intermittently - #1060

Merged
SlimaneAmar merged 1 commit into
mainfrom
fix_testCreateStudyWithErrorDuringCaseImport_race_condition
Aug 13, 2026
Merged

Fix a race condition with testCreateStudyWithErrorDuringCaseImport wich fail intermittently#1060
SlimaneAmar merged 1 commit into
mainfrom
fix_testCreateStudyWithErrorDuringCaseImport_race_condition

Conversation

@SlimaneAmar

Copy link
Copy Markdown
Contributor

PR Summary

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change removes optimistic-lock exception handling from study deletion. It also updates network import failure stubs and tests to use HTTP 200 while preserving asynchronous failure notifications and cleanup checks.

Changes

Study deletion

Layer / File(s) Summary
Direct study deletion
src/main/java/org/gridsuite/study/server/service/StudyService.java
Study and related resources are deleted directly without optimistic-lock exception recovery. Pending creation requests remain handled separately.

Asynchronous network import handling

Layer / File(s) Summary
Asynchronous import response and validation
src/test/java/org/gridsuite/study/server/utils/wiremock/NetworkConversionServerStubs.java, src/test/java/org/gridsuite/study/server/studycontroller/StudyTest.java
The import failure stub returns HTTP 200. The test expects HTTP 200 and continues to verify asynchronous failure notifications and cleanup.

Suggested reviewers: francklecuyer

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description contains only a template comment and does not explain the race-condition fix. Add a concise summary of the race-condition fix and the expected behavior change.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the intermittent test race condition addressed by the pull request, despite a minor spelling error.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/test/java/org/gridsuite/study/server/utils/wiremock/NetworkConversionServerStubs.java (1)

148-148: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename the helper to reflect asynchronous failure.

stubImportNetworkWithServerError now returns WireMock.ok(). Keep HTTP 200 for this asynchronous failure scenario, but rename the helper and related test identifiers so they do not imply an HTTP 500 response.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/org/gridsuite/study/server/utils/wiremock/NetworkConversionServerStubs.java`
at line 148, Rename stubImportNetworkWithServerError and all related test
identifiers to names that describe asynchronous failure without implying an HTTP
500 response. Preserve the WireMock.ok() HTTP 200 response and update every
reference consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@src/test/java/org/gridsuite/study/server/utils/wiremock/NetworkConversionServerStubs.java`:
- Line 148: Rename stubImportNetworkWithServerError and all related test
identifiers to names that describe asynchronous failure without implying an HTTP
500 response. Preserve the WireMock.ok() HTTP 200 response and update every
reference consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6fb0e1a4-1076-4ced-a57e-af6cdc222526

📥 Commits

Reviewing files that changed from the base of the PR and between fcd627b and 77be570.

📒 Files selected for processing (3)
  • src/main/java/org/gridsuite/study/server/service/StudyService.java
  • src/test/java/org/gridsuite/study/server/studycontroller/StudyTest.java
  • src/test/java/org/gridsuite/study/server/utils/wiremock/NetworkConversionServerStubs.java

@sonarqubecloud

Copy link
Copy Markdown

@SlimaneAmar
SlimaneAmar merged commit 0718586 into main Aug 13, 2026
5 checks passed
@SlimaneAmar
SlimaneAmar deleted the fix_testCreateStudyWithErrorDuringCaseImport_race_condition branch August 13, 2026 07: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.

2 participants