-
Notifications
You must be signed in to change notification settings - Fork 136
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
Keep track of pings in all modes #378
Conversation
We need to keep track of pings, so they get re-registered after a reset. This state is kept across Glean resets, which should only ever happen in test mode. Or by the instrumentation tests (`connectedAndroidTest`), which relaunches the application activity, but not the whole process, meaning globals, such as the ping types, still exist from the old run. I'm not super happy with keeping this state around, but given that the queue is actually a set and it's unlikely to have hundreds and hundreds of custom pings it should not have much of an impact.
cc @brizental |
// This state is kept across Glean resets, which should only ever happen in test mode. | ||
// Or by the instrumentation tests (`connectedAndroidTest`), which relaunches the application activity, | ||
// but not the whole process, meaning globals, such as the ping types, still exist from the old run. | ||
// It's a set and keeping them around forver should not have much of an impact. |
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.
Would it make sense to try to reset in the GleanTestRunner
?
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.
Yeah, I'm too am curious if we can fix this in a testing-only way...
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 considered it, but decided against it for reasons:
- Low overhead even in production
- It's yet another configuration/state the GleanTestRunner runs in compared to unit tests and production mode.
- I'd like the tests to run as close to production as possible, otherwise we might miss other problems
- It was easier to remove code than to add :P
glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt
Outdated
Show resolved
Hide resolved
// This state is kept across Glean resets, which should only ever happen in test mode. | ||
// Or by the instrumentation tests (`connectedAndroidTest`), which relaunches the application activity, | ||
// but not the whole process, meaning globals, such as the ping types, still exist from the old run. | ||
// It's a set and keeping them around forver should not have much of an impact. |
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.
Yeah, I'm too am curious if we can fix this in a testing-only way...
Co-Authored-By: Michael Droettboom <[email protected]>
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.
Ok... good points. 👍
Codecov Report
@@ Coverage Diff @@
## master #378 +/- ##
============================================
+ Coverage 75.76% 75.76% +<.01%
+ Complexity 308 307 -1
============================================
Files 95 95
Lines 5323 5319 -4
Branches 631 629 -2
============================================
- Hits 4033 4030 -3
Misses 825 825
+ Partials 465 464 -1
Continue to review full report at Codecov.
|
We need to keep track of pings, so they get re-registered after a reset.
This state is kept across Glean resets, which should only ever happen in test mode.
Or by the instrumentation tests (
connectedAndroidTest
), which relaunches the application activity,but not the whole process, meaning globals, such as the ping types, still exist from the old run.
I'm not super happy with keeping this state around, but given that the
queue is actually a set and it's unlikely to have hundreds and hundreds
of custom pings it should not have much of an impact.