GJL opened a new pull request #7839: [FLINK-10585][tests] Fix 
RestServerEndpointITCase instability
URL: https://github.com/apache/flink/pull/7839
 
 
   ## What is the purpose of the change
   
   *This fixes a rare test instability that occurs if the RestServerEndpoint is 
only accessible via one protocol stack (either IPv4 or IPv6).*
   
   ## Brief change log
   
     - *Re-create testing keystore and truststore (`local127.keystore`, 
`local127.truststore`)*
     - *Change RestServerEndpointITCase so that we explicitly bind the 
RestServerEndpoint under test on loopback address*
     - *Use java.net.URL to build restBaseUrl. This enables to bind the 
RestServerEndpoint to a IPv6 address*
     - *Extract method getTestResource in RestServerEndpointITCase*
   
   
   ## Verifying this change
   
   This change is already covered by existing tests, such as 
*RestServerEndpointITCase*.
   
   This change added tests and can be verified as follows:
   
     - *Verify that `RestServerEndpointITCase` fails with `BindException` if 
rest port is occupied*
       1. *Set `RestOptions.BIND_PORT` to `"12345"`*
       1. *In another terminal, run `nc -l 127.0.0.1 12345`*
       1. *In another terminal, use `netstat` to verify that a tcp4 socket 
listening on port 12345 is open: `netstat -vanp tcp | grep 12345`*
       1. `mvn clean integration-test -pl flink-runtime -am 
-Dtest=RestServerEndpointITCase -Dfast -DfailIfNoTests=false 
-Dsurefire.skipAfterFailureCount=1 -Djava.net.preferIPv4Stack=true`
       1. *Verify that tests failed with: java.net.BindException: Could not 
start rest endpoint on any port in port range 12345*
       1. *Verify that the terminal running `nc` does not show any output*
   
     - *Verify that `RestServerEndpointITCase` passes with IPv6:*
       1. *Set `RestOptions.BIND_PORT` to `"12345"`*
       1. *In another terminal, run `nc -l 127.0.0.1 12345`*
       1. `mvn clean integration-test -pl flink-runtime -am 
-Dtest=RestServerEndpointITCase -Dfast -DfailIfNoTests=false 
-Dsurefire.skipAfterFailureCount=1 -Djava.net.preferIPv6Addresses=true`
       1. Tests should pass
   
     
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** 
/ don't know)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / 
JavaDocs / not documented)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to