-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix: 1707 web validator waits for validation forever #1711
fix: 1707 web validator waits for validation forever #1711
Conversation
This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: |
@@ -153,7 +166,7 @@ private Optional<String> resolveLatestReleaseVersion(Optional<String> currentVer | |||
new URL( | |||
String.format( | |||
"%s?application_type=%s¤t_version=%s", | |||
LATEST_RELEASE_VERSION_URL, applicationType, currentVersion.orElse("Ï"))); |
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.
I don't know why this character "Ï"
was there.
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!
✅ Rule acceptance tests passed. |
✅ Rule acceptance tests passed. |
Summary:
Closes #1707
If there is no timeout on the version endpoint, this PR changes nothing.
Changed the code so it does not generate an exception when the version endpoint is called but times out.
Another problem was that the current version (obtained from the jar files) was discarded if there was a time out calling the version endpoint.
Expected behavior:
Web validator does not hang forever if there is a timeout while calling the version endpoint.
If the timeout happens, the version is still correct in report.html
** Testing tips **
The timeout is intermittent, and probably only occurs when the validator service is brought up.
To test this, you could add a delay in VersionResolver.java, e.g. Thread.sleep(5100) to simulate that the endpoint takes a long time to respond. The delay should be above 5000 ms, since it's the time used for the timeout.
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything