[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8206187: javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java fails
From:       Kevin Walls <kevinw () openjdk ! java ! net>
Date:       2022-02-25 8:00:02
Message-ID: CNkoA3StnxVuWojiObpXS0oDaX653gqqH_C4pl_aCYg=.f8a7a777-124e-48d5-90b6-90f23fd33965 () github ! com
[Download RAW message or body]

On Wed, 23 Feb 2022 13:59:19 GMT, Kevin Walls <kevinw@openjdk.org> wrote:

> Test fails occasionally due to a port clash.
> Presumably the port that was returned by Utils.getFreePort(), is no longer free.
> The test creates a ProcessBuilder with the parameters for JMX, including port \
> number, and uses that to create a new Process. It should retry with a new port if \
> we fail due to a port in use, for some limited number of attempts. 
> main already has some retry logic, but not working:
> it checks for an InvocationTargetException to contain a BindException, but it \
> simply gets a BindException, thrown by TestAppRun.start(). TestAppRun.start() runs \
> the new process and scans for errors, but on failure its predicate has only seen \
> the first line of a failure, so a BindException is never recognised and thrown. \
> Also main does not limit the retries, and handling the port retry in main() is \
> duplicated, for each run of the test method. 
> So...
> 
> Make the error-scanning predicate in TestAppRun recognise a "port in use" message \
> and throw a BindExeption.  This is a notification to the caller that it failed, \
> it's not the actual BindException as that was thrown in a different process. Make \
> the testDefaultAgent method (the main part of the test) handle retrying with a new \
> port, a limited number of times.

This pull request has now been integrated.

Changeset: cd36be42
Author:    Kevin Walls <kevinw@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/cd36be42c2eb3eacdb3625e87510eb15acac3230
                
Stats:     82 lines in 1 file changed: 30 ins; 30 del; 22 mod

8206187: javax/management/remote/mandatory/connection/DefaultAgentFilterTest.java \
fails with Port already in use

Reviewed-by: msheppar, amenkov

-------------

PR: https://git.openjdk.java.net/jdk/pull/7589


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic