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.
Description
Fixed the flaky test
testGetWsdl
insideNettyServerTest.java
class.cxf/rt/transports/http-netty/netty-server/src/test/java/org/apache/cxf/transport/http/netty/server/integration/NettyServerTest.java
Line 86 in 3048785
Root Cause
The test
testGetWsdl
has been reported as flaky when run with the NonDex tool. The test failed because it is trying to find if a certain element(<service name"SOAPService">
) is present inside the XML file which is returned by calling WSDL service. But there is slight change in the content of XML returned by the service. For example, in some cases the XML returned contained elements with:wsdl
prefix. So instead of<service name"SOAPService">
, the XML content contained<wsdl:service name"SOAPService">
. As a result the test is failed.Fix
After debugging the code, it is clear that XML content with
wsdl:
prefix, means that the elements are qualified by the namespace, and when you see the same tags without the prefix, the XML is still using the WSDL namespace, but it's defined as the default namespace, so the prefix is not necessary. So, the test is fixed by adding a condition to check if the element withwsdl:
is present.How this has been tested?
Java: openjdk version "11.0.20.1"
Maven: Apache Maven 3.6.3
Command used -
Command used -
Command used -
NonDex test passed after the fix.