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

Keep track of pings in all modes #378

Merged
merged 2 commits into from
Oct 16, 2019
Merged

Keep track of pings in all modes #378

merged 2 commits into from
Oct 16, 2019

Conversation

badboy
Copy link
Member

@badboy badboy commented Oct 15, 2019

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.

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.
@badboy
Copy link
Member Author

badboy commented Oct 15, 2019

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.
Copy link
Contributor

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?

Copy link
Contributor

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...

Copy link
Member Author

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

// 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.
Copy link
Contributor

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...

Copy link
Contributor

@mdboom mdboom left a 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-io
Copy link

codecov-io commented Oct 16, 2019

Codecov Report

Merging #378 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ Complexity Δ
...oid/src/main/java/mozilla/telemetry/glean/Glean.kt 87.43% <100%> (+1.33%) 1 <0> (ø) ⬇️
...c/main/java/mozilla/telemetry/glean/Dispatchers.kt 82.22% <0%> (-2.23%) 1% <0%> (ø)
.../telemetry/glean/scheduler/MetricsPingScheduler.kt 94.93% <0%> (-1.27%) 24% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8bff641...9da2168. Read the comment docs.

@badboy badboy merged commit 764b076 into master Oct 16, 2019
@badboy badboy deleted the keep-ping-type-queue branch October 16, 2019 14:46
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.

5 participants