Fix flaky telemetry tests #3707
Merged
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.
Description
Fixes flaky telemetry tests resetting the state in
MapboxNavigationTelemetry#initializeRegression from #3540
bug,feature,new API(s),SEMVER, etc.)Goal
Fix flaky telemetry tests
@Ignoredin eb7dce6Implementation
MapboxNavigationTelemetryis anobject(singleton)originalRoutewas retained across tests violating theIndependent principle from F.I.R.S.T.. Tests executed beforeMapboxNavigationTelemetryTestcould leaveMapboxNavigationTelemetryin an undesired state which caused the flakiness / exceptionIn this particular case
originalRoutewas retained from a previous test causingdepart_events_are_different_on_external_routeto fail asrouteProgresswasnull/ not initialized whenonRoutesChanged>handleReroutewere executed.We need to make sure that the state is reset appropriately.
Testing
SNAPSHOTupstream dependencies if needed) through testapp/demo app and run all activities to avoid regressionsChecklist
CHANGELOGincluding this PRapi/current.txtfiles after running$> make core-update-api(Core) /$> make ui-update-api(UI) if there are changes / errors we're 🆗 with (e.g.AddedMethodchanges are marked as errors but don't break SemVer) 🚀 If there are SemVer breaking changes add theSEMVERlabel. See Metalava docs