-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Timeout jlm server connection using elapsed time and nbr attempts #369
Timeout jlm server connection using elapsed time and nbr attempts #369
Conversation
attempts Signed-off-by: Simon Rushton <rushton@uk.ibm.com>
Fixes #370 |
openjdk.test.jlm/src/test.jlm/net/adoptopenjdk/test/jlm/remote/ServerConnector.java
Outdated
Show resolved
Hide resolved
openjdk.test.jlm/src/test.jlm/net/adoptopenjdk/test/jlm/remote/ServerConnector.java
Show resolved
Hide resolved
if (attempts == 30) { | ||
Message.logOut("Failed to connect to Monitored VM after 30 attempts - giving up. Connection Exception received is below:"); | ||
if (connectElapsed > connectTimeout || attempts == 30 ) { | ||
Message.logOut("Failed to connect to Monitored VM after " + attempts + " attempts in " + (connectElapsed / 1000000000) + " seconds - giving up. Connection Exception received is below:"); |
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.
magic number could be extracted
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.
Which 'magic number' are you referring to, please?
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.
The 30 and the 1000000000 could both be extracted?
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.
Thanks for clarifying. By 'extracted' you mean something like
maxAttempts = 30;
nanosecondsPerSecond = 1000L * 1000L * 1000L;
?
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.
Something like that yes, it's probably just personal programming style preference, but makes it easier to parameterize/override later.
Signed-off-by: Simon Rushton <rushton@uk.ibm.com>
Signed-off-by: Simon Rushton <rushton@uk.ibm.com>
@karianna - I've refactored the code to get rid of the duplicate code between New test run is here: https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/4267. When we're ready to merge, please can we "Squash and merge". No need to include my debugging and typo commits in the repository history. |
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
@lumpfish - I'm happy with it (thank you!) - save to merge during release day? |
Merging now the Oct 2020 releases are finished. |
attempts
Signed-off-by: Simon Rushton rushton@uk.ibm.com