Skip to content
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

Cleanup httpurlconnection androidTests #503

Conversation

surbhiia
Copy link
Contributor

@surbhiia surbhiia commented Jul 31, 2024

This PR cleans up httpurlconnection androidTests based on learnings and discussions from PR #452 and PR #500:

  • Keep tests synchronous.
  • Address any open comments.

@surbhiia surbhiia requested a review from a team July 31, 2024 21:19
} else {
// if all tasks don't finish before timeout
Assert.fail(
fail(
"Test could not be completed as tasks did not complete within the 2s timeout period.",
)
}
} catch (e: InterruptedException) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Preference is to just let the exception escape the method and the test will still fail.

@@ -67,46 +70,39 @@ class InstrumentationTest {
// Wait for all tasks to finish execution or timeout
if (executor.awaitTermination(2, TimeUnit.SECONDS)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

instead if if you can just wrap with assertTrue() and remove the else block entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, That makes the code cleaner! Thanks :)

@LikeTheSalad LikeTheSalad merged commit 059a829 into open-telemetry:main Aug 2, 2024
3 checks passed
@surbhiia surbhiia deleted the develop/HttpURLConnection-androidTestsUpdates2 branch November 12, 2024 22:19
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.

3 participants