Skip to content

fix: 1707 web validator waits for validation forever#1711

Merged
jcpitre merged 8 commits intomasterfrom
1707-web-validator-waits-for-validation-forever
Mar 12, 2024
Merged

fix: 1707 web validator waits for validation forever#1711
jcpitre merged 8 commits intomasterfrom
1707-web-validator-waits-for-validation-forever

Conversation

@jcpitre
Copy link
Copy Markdown
Contributor

@jcpitre jcpitre commented Mar 12, 2024

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!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@jcpitre jcpitre linked an issue Mar 12, 2024 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

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: ./gradlew goJF.

@jcpitre jcpitre changed the title 1707 web validator waits for validation forever fix: 1707 web validator waits for validation forever Mar 12, 2024
@jcpitre jcpitre marked this pull request as ready for review March 12, 2024 17:26
new URL(
String.format(
"%s?application_type=%s&current_version=%s",
LATEST_RELEASE_VERSION_URL, applicationType, currentVersion.orElse("Ï")));
Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions
Copy link
Copy Markdown
Contributor

✅ Rule acceptance tests passed.
New Errors: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1520 sources (~0 %) are corrupted.
Commit: 81c32f5
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

@github-actions
Copy link
Copy Markdown
Contributor

✅ Rule acceptance tests passed.
New Errors: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Errors: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
New Warnings: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
Dropped Warnings: 0 out of 1520 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
0 out of 1520 sources (~0 %) are corrupted.
Commit: c8c30d1
Download the full acceptance test report here (report will disappear after 90 days).
✅ Rule acceptance tests passed.

@jcpitre jcpitre merged commit cf6b629 into master Mar 12, 2024
@jcpitre jcpitre deleted the 1707-web-validator-waits-for-validation-forever branch March 12, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web validator waits for validation forever

2 participants