chore: action execution solution test fixed#37793
Conversation
WalkthroughThe changes to the Changes
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCETest.java (1)
Line range hint
249-255: Enhance cleanup method robustnessThe cleanup method should handle potential failures during deletion operations. Consider:
- Adding error handling for deletion failures
- Verifying all resources are properly cleaned up
- Adding logging for cleanup operations
@AfterEach public void cleanup() { + log.info("Starting test cleanup"); List<Application> deletedApplications = applicationService .findByWorkspaceId(workspaceId, applicationPermission.getDeletePermission()) .flatMap(remainingApplication -> applicationPageService.deleteApplication(remainingApplication.getId())) + .doOnError(error -> log.error("Error during application cleanup: {}", error.getMessage())) + .onErrorResume(error -> Mono.empty()) .collectList() .block(); Workspace deletedWorkspace = workspaceService.archiveById(workspaceId) + .doOnError(error -> log.error("Error during workspace cleanup: {}", error.getMessage())) + .onErrorResume(error -> Mono.empty()) .block(); + log.info("Completed test cleanup"); }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCETest.java(1 hunks)
🔇 Additional comments (1)
app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCETest.java (1)
730-734: Verify mock behavior for stale connection recovery
The test uses thenThrow() followed by thenReturn() to simulate a stale connection recovery scenario. While this works, consider adding assertions to verify:
- The number of retry attempts
- The time between retries
✅ Verification successful
Let me search for retry configuration in the actual implementation code rather than test resources and build scripts.
Let me try searching with different patterns to find retry-related code.
Let me search for the retry configuration in the implementation code.
Based on the search results from the previous commands, I can now provide a final response about the stale connection retry behavior.
The retry mechanism for stale connections is properly implemented
The code shows a well-structured retry mechanism where:
DatasourceContextService.retryOnce()handles the retry logic- On
StaleConnectionException, it deletes the stale context and retries once - The test correctly verifies this behavior by simulating a stale connection followed by success
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for retry configuration in the codebase
rg -A 5 "retryPolicy|maxRetries|retryCount"
Length of output: 61158
Script:
#!/bin/bash
# Search for retry configuration in the implementation code
rg -g "*.java" -A 5 "retryPolicy|maxRetries|retryCount" app/server/appsmith-server/src/main/java/
Length of output: 99
Script:
#!/bin/bash
# Search for retry-related code in implementation and test files
rg -g "*.java" -B 5 -A 5 "StaleConnectionException|retry" app/server/appsmith-server/src/
Length of output: 60549
Script:
#!/bin/bash
# Search for the retry configuration in DatasourceContextService implementation
ast-grep --pattern 'onErrorResume(StaleConnectionException.class, error -> {
$$$
return deleteDatasourceContext($$$).then($$$);
})' app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/DatasourceContextServiceCEImpl.java
Length of output: 246
Failing server unit test fixed, This test started failing due to changes in this PR: #37776, for some reason it did not show up on this Pr in failed test cases Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ /ok-to-test tags="@tag.IconButton" <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12066311357> > Commit: f915b4f > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12066311357&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IconButton` > Spec: > <hr>Thu, 28 Nov 2024 09:59:28 UTC <!-- end of auto-generated comment: Cypress test results --> Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> - **Bug Fixes** - Improved error handling for stale connections during action execution, allowing the system to recover and continue executing actions after an initial failure. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: “sneha122” <“sneha@appsmith.com”>
## Description Failing server unit test fixed, This test started failing due to changes in this PR: appsmithorg#37776, for some reason it did not show up on this Pr in failed test cases Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.IconButton" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12066311357> > Commit: f915b4f > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12066311357&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IconButton` > Spec: > <hr>Thu, 28 Nov 2024 09:59:28 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved error handling for stale connections during action execution, allowing the system to recover and continue executing actions after an initial failure. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: “sneha122” <“sneha@appsmith.com”>
Description
Failing server unit test fixed, This test started failing due to changes in this PR: #37776, for some reason it did not show up on this Pr in failed test cases
Fixes #
Issue Numberor
Fixes
Issue URLWarning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.IconButton"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12066311357
Commit: f915b4f
Cypress dashboard.
Tags:
@tag.IconButtonSpec:
Thu, 28 Nov 2024 09:59:28 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit