-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #6060]Optimize AutoSwitchRoleBase#nextPort method #6068
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #6068 +/- ##
=============================================
- Coverage 43.25% 43.22% -0.03%
+ Complexity 8850 8838 -12
=============================================
Files 1093 1093
Lines 77071 77071
Branches 10050 10050
=============================================
- Hits 33335 33315 -20
- Misses 39572 39585 +13
- Partials 4164 4171 +7
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
tempPort = random.nextInt(maxPort) % (maxPort - minPort + 1) + minPort; | ||
ServerSocket serverSocket = new ServerSocket(tempPort); | ||
port = serverSocket.getLocalPort(); | ||
serverSocket.close(); | ||
break; | ||
} catch (IOException ignored) { | ||
if (number > 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about merge numer>200
and number++
? Just if (number++ >200)
Make sure set the target branch to
develop
What is the purpose of the change
fix #6060
Brief changelog
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.