Bug Fix: Resolve Error Blocking Local Environment Setup#1557
Open
yashasip wants to merge 1 commit into
Open
Conversation
|
Cannot start a pipeline due to: Click on pipeline status check Details link below for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for Issue: #1498
Problem
RestApiViolationsTest.shouldReturn404WhenHostNotRecognised()was failing, causing./gradlew clean buildto break.The test was asserting two things:
404"Unknown host while retrieving api definition url: remote-localhost"The second assertion was failing because the error message is environment-sensitive and not guaranteed to be stable.
Root Cause
When a request results in a
404, the error message in the response body varies depending on why the connection failed. There are 3 possible cases:Unknown host while retrieving api definition url: remote-localhostUnknown host while retrieving api definition url: Connection refused404 : "---<EOL>timestamp: "2026-03-06T14:18:26.370+00:00"<EOL>status: 404<EOL>error: "Not Found"<EOL>path: "/"<EOL>" while retrieving api definition urlWhen this test was originally written,
http://remote-localhost/test.yamlwas hitting Case 1 (DNS resolution failure). However, today the hostnameremote-localhostresolves successfully but the server is unreachable, which means it now hits Case 2, producing a different message and breaking the assertion.Fix
Removed the response body message assertion, keeping only the status code assertion (
404 NOT_FOUND). This is sufficient to validate the behaviour of the endpoint and makes the test resilient to environment-specific message variations.Alternative Fix (if message assertion is desired)
If you want to keep the message assertion, update the expected value to match the current environment:
However, this would remain brittle across different environments and is not recommended.