Skip to content

Fix test failure#4738

Open
Piumal1999 wants to merge 1 commit intowso2:masterfrom
Piumal1999:master
Open

Fix test failure#4738
Piumal1999 wants to merge 1 commit intowso2:masterfrom
Piumal1999:master

Conversation

@Piumal1999
Copy link
Copy Markdown

@Piumal1999 Piumal1999 commented Mar 16, 2026

Purpose

Update the ESBJAVA4394 test case to align with the fix: wso2/wso2-synapse#2431

Summary

In the test, since the request is written through the reachable first hop and the downstream side terminates later, endOfInput() is triggered while the state is REQUEST_DONE.

Previously, endOfInput() method only invoked conn.close(). As a result, closed() method was triggered later to handle the fault while the state was still REQUEST_DONE. Then, handleError() was called with CONNECTION_CLOSED (base error code 101505) and state REQUEST_DONE (ordinal 3) [1].

Inside handleError(), the final error is computed as: finalError = baseErrorCode + state.ordinal()[2]

So the final error became 101508, which was asserted in the test.

However, after changing endOfInput() with PR [3] to directly call handleError() with SND_IO_ERROR (base error code 101500) using the same state, the base error code changed to 101500 while the state remained REQUEST_DONE (ordinal 3). As a result, the final error became 101503.

Related PRs

#4312

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted SOAP fault validation so the system now recognizes and reports the correct fault code (101503) in relevant failure scenarios, improving error accuracy and test alignment.

@Piumal1999 Piumal1999 requested a review from rosensilva as a code owner March 16, 2026 06:49
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 086dd8f5-94d1-4400-bda1-f7e6e1037d06

📥 Commits

Reviewing files that changed from the base of the PR and between 1912e16 and 06f12e0.

📒 Files selected for processing (1)
  • integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java
✅ Files skipped from review due to trivial changes (1)
  • integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java

Walkthrough

A single test assertion in ESBJAVA4394 was modified to expect SOAP fault code "101503" instead of "101508" in the Axis fault message check.

Changes

Cohort / File(s) Summary
Test Assertion Update
integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java
Changed assertion that validates the Axis fault message to expect fault code 101503 (was 101508).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A small hop in test-land, neat and quick,
Code changed by one line, nimble as a trick.
From 101508 to 101503 I cheer,
The rabbit nods—this test is clear. 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix test failure' is vague and generic, using non-descriptive phrasing that doesn't convey the specific change made to the test. Provide a more specific title that indicates the exact change, such as 'Update ESBJAVA4394 test to expect fault code 101503 instead of 101508'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description provides comprehensive context about the underlying change in wso2-synapse, the reason for the test update, and includes links to related issues and PRs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java (1)

53-53: Comments reference stale error code "101508".

The assertion now expects fault code 101503, but the comments on lines 28–31 still reference 101508. This inconsistency may confuse future maintainers.

Consider updating the comments to reflect the corrected error code:

📝 Proposed comment updates
-         * the 2nd listeners target port is not the actual service port, because by making the 2nd tcpmon listener to
-         * connect to a non existing port we could simulate the 101508 error.
+         * the 2nd listeners target port is not the actual service port, because by making the 2nd tcpmon listener to
+         * connect to a non existing port we could simulate the 101503 error.
          *
-         * Without the fix of ESBJAVA-4394, when a 101508 happens the response is not send back
+         * Without the fix of ESBJAVA-4394, when a 101503 happens the response is not send back
          * to the client. (client gets empty response)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java`
at line 53, Update the stale inline comment that references error code "101508"
to the corrected code "101503" so it matches the assertion in ESBJAVA4394 (the
test containing assertTrue(axisFaultMessage.contains("101503"))); locate the
comment block around the test (previously lines 28–31) and change the referenced
error code and any explanatory text to reference 101503 consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java`:
- Line 53: Update the stale inline comment that references error code "101508"
to the corrected code "101503" so it matches the assertion in ESBJAVA4394 (the
test containing assertTrue(axisFaultMessage.contains("101503"))); locate the
comment block around the test (previously lines 28–31) and change the referenced
error code and any explanatory text to reference 101503 consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f917c62c-b53a-4d4e-b185-94cf90c1417f

📥 Commits

Reviewing files that changed from the base of the PR and between bf97f40 and 1912e16.

📒 Files selected for processing (1)
  • integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/passthru/transport/test/ESBJAVA4394.java

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