Stabilize integration tests#1329
Merged
Merged
Conversation
Set the telemetry test to verify it got all the telemetry it expected, but ignore any extra telemetry it might encounter. Add a method to allow the RUM event queue to settle before getting the RUM context to avoid testing against bad ViewIds Consider ApplicationLaunch and regular events separately, since ApplicationLaunch events can be highly order dependent.
fuzzybinary
force-pushed
the
jward/integration-test-fixes
branch
from
March 7, 2023 19:02
6139221 to
81f6158
Compare
0xnm
reviewed
Mar 8, 2023
| if (!executorService.isShutdown) { | ||
| val latch = CountDownLatch(1) | ||
| // Submit an empty task, and wait for it to complete | ||
| executorService.submit { |
| " got (${telemetryEvents.size}) which is less than expected." | ||
| ) | ||
| .hasSameSizeAs(expectedTelemetry) | ||
| .isGreaterThanOrEqualTo(expectedTelemetry.size) |
Member
There was a problem hiding this comment.
why number of telemetry events may vary? is it because we send configuration telemetry with delay?
Member
Author
There was a problem hiding this comment.
It's more that we sometimes can't control what will send telemetry during the integration test. Right now I only ever see 4, with the 4th being something from the Activity. But that doesn't mean other telemetry couldn't sneak its way in.
xgouchet
reviewed
Mar 8, 2023
| latch.countDown() | ||
| } | ||
| try { | ||
| latch.await() |
Contributor
There was a problem hiding this comment.
Maybe we could add a timeout here in case something is blocking the executor indefinitely?
| try { | ||
| latch.await() | ||
| } catch (_: InterruptedException) { | ||
| } |
Contributor
There was a problem hiding this comment.
Let's not swallow the exception here and at least send it to the Maintainers via internalLogger
…droid/sdk/integration/telemetry/TelemetryTest.kt Co-authored-by: Nikita Ogorodnikov <[email protected]>
0xnm
approved these changes
Mar 8, 2023
xgouchet
approved these changes
Mar 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This attempts to remove flakeyness from our integration tests by fixing 3 major issues:
application_startaction is sent, which is highly dependent on how long it takes for it to get written to storage. Because of this, I've split out checking all the regular events from checking any events associated with tracking application launch.Review checklist (to be filled by reviewers)