mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

Refactor incorrect `CoreRerouteTest` and `RouteAlternativesTest` #4429

Closed Guardiola31337 closed 3 years ago

Guardiola31337 commented 3 years ago

An issue caught by an Instrumentation test found while working on https://github.com/mapbox/mapbox-navigation-android/pull/4419 https://app.circleci.com/pipelines/github/mapbox/mapbox-navigation-android/12041/workflows/6cc8f997-07d1-49f4-a898-9243e7ace970/jobs/48760 https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/5010895745904766073/executions/bs.1e3c7202ff856a89/testcases/2/errors

java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:87)
at org.junit.Assert.assertTrue(Assert.java:42)
at org.junit.Assert.assertTrue(Assert.java:53)
at com.mapbox.navigation.instrumentation_tests.core.RouteAlternativesTest.expect_faster_route_alternatives(RouteAlternativesTest.kt:79)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at androidx.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:134)
at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
at com.schibsted.spain.barista.rule.cleardata.ClearDatabaseRule$apply$1.evaluate(ClearDatabaseRule.kt:30)
at com.schibsted.spain.barista.rule.cleardata.ClearPreferencesRule$1.evaluate(ClearPreferencesRule.java:26)
at com.schibsted.spain.barista.rule.cleardata.ClearFilesRule$apply$1.evaluate(ClearFilesRule.kt:25)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2074)

cc @RingerJK @kmadsen

Guardiola31337 commented 3 years ago

It seems related to the RouteAlternativesIdlingResource and the fact that now (ttps://github.com/mapbox/mapbox-navigation-android/pull/4419) onStatus are controlled by NN.

kmadsen commented 3 years ago

Looking at the logs, the test is actually looking good.

the integration test should work with new changes of nav-native, because it doesn't mock nav native.

Are you saying we need to change the behavior of the RoutesObserver?

kmadsen commented 3 years ago

RouteAlternativesController also pulls the RouteProgress from the TripSession

https://github.com/mapbox/mapbox-navigation-android/blob/540480132c4f7635810e5f978026ffff98182b5a/libnavigation-core/src/main/java/com/mapbox/navigation/core/routealternatives/RouteAlternativesController.kt#L104

^ is the TripSession RouteProgress getting updated?

kmadsen commented 3 years ago

The test is failing because

assertTrue(alternativeRouteDuration < durationRemaining)

You could add a log in your pull request, to see what those duration values are. The alternative route is hardcoded to be faster than the current route. Did something change there?

Guardiola31337 commented 3 years ago
2021-05-21 18:52:04.828 6157-6196/com.mapbox.navigation.instrumentation_tests E/PGS: alternativeRouteDuration=320.427 < durationRemaining=296.209
Guardiola31337 commented 3 years ago

Is

assertTrue(alternativeRouteDuration < durationRemaining)

repeatable? I mean, it seems this

// Prepare with a slow alternative route.
val coordinates = listOf(
    Point.fromLngLat(-121.46685, 38.56301),
    Point.fromLngLat(-121.445697, 38.56707)
)

is not always true / valid.

kmadsen commented 3 years ago

alternativeRouteDuration=320.427 < durationRemaining=296.209

the alternativeRouteDuration is supposed to come from a mocked response. That value comes from a file and is 296.209

🤔 it seems the values are flipped on your branch. I just tried it again on the main branch and this is what I'm getting Screen Shot 2021-05-21 at 1 42 44 PM

kmadsen commented 3 years ago

Looking at the logs, it appears the navigator goes off route. Maybe this is the issue? https://console.firebase.google.com/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/5658557208547000507/executions/bs.ebe194bc5796461a/testcases/2/logs

com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
05-21 13:52:29.831: I/PlacesLogger(18887): [PlaceInferenceEngine]: Too few candidate results: percentageOfMissingArea 100 [CONTEXT service_id=253 ]
05-21 13:52:29.843: D/MbxTelemetry(21498): populateNavigationEvent
05-21 13:52:29.844: D/MbxTelemetry(21498): class com.mapbox.navigation.core.telemetry.events.NavigationDepartEvent event sent
05-21 13:52:29.845: D/MbxTelemetry(21498): onOffRouteStateChanged true
05-21 13:52:29.845: D/MbxRerouteController(21498): Fetching route
05-21 13:52:29.862: V/ContextHubHal(705): queryApps
05-21 13:52:29.863: V/ContextHubHal(705): Got nanoapp list response with 6 apps
05-21 13:52:29.863: V/ContextHubHal(705): App 0x476f6f676c00100b ver 0x20004 enabled 1 system 0
05-21 13:52:29.863: V/ContextHubHal(705): App 0x476f6f676c00100e ver 0x1 enabled 1 system 0
05-21 13:52:29.863: V/ContextHubHal(705): App 0x476f6f676c001004 ver 0x40001 enabled 1 system 0
05-21 13:52:29.863: V/ContextHubHal(705): App 0x476f6f676c001011 ver 0x10001 enabled 1 system 0
kmadsen commented 3 years ago

I'd think it was an issue with the test if it was happening on the main line. But those re-routes are not happening there, only on the new dev branch.

Here is a recent run that shows no onOffRouteStateChange true events https://console.firebase.google.com/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/6604507411565890279/executions/bs.1c57239bab83fea0/testcases/2

Guardiola31337 commented 3 years ago

Interesting, I cannot reproduce consistently locally. Was wondering if it was because of missing routing tiles but I uninstalled the app and re-run the test and passed 🤔

Any ideas @DmitryAk?

At the moment we cannot retrieve a history file due to https://github.com/mapbox/mapbox-navigation-android/pull/4478 😬

Guardiola31337 commented 3 years ago

Last run AlternativeRouteSelectionTest#selectAlternateRoute failed https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/4908335199249285018/executions/bs.5c115477058a2782/testcases/6/logs

06-07 02:15:38.996: W/System.err(21218): java.lang.AssertionError: expected:<DirectionsRoute{routeIndex=0, distance=1683.8, duration=207.3, durationTypical=null, geometry=mvl`gAnalshFa@iVUuMG}D[{Rq@y`@ScLaB{aA{@gi@[kQGmEIqE[yQ{@uh@aAgl@_@{Ta@qU_Agk@wl@hBiRj@eELag@|AiDJkELimB~FusBlGwAg|@IuDGwDoAwu@GmEsDLcIVooAxDqCHoFPaGP}FPTlN, weight=365.4, weightName=routability, legs=[RouteLeg{distance=1683.8, duration=207.3, durationTypical=null, summary=Fulton Street, 27th Avenue, admins=null, steps=[LegStep{distance=628.0, duration=63.099999999999994, durationTypical=null, speedLimitUnit=mph, speedLimitSign=mutcd, geometry=mvl`gAnalshFa@iVUuMG}D[{Rq@y`@ScLaB{aA{@gi@[kQGmEIqE[yQ{@uh@aAgl@_@{Ta@qU_Agk@, name=Fulton Street, ref=null, destinations=null, mode=driving, pronunciation=null, rotaryName=null, rotaryPronunciation=null, maneuver=StepManeuver{rawLocation=[-122.49348, 37.772151], bearingBefore=0.0, bearingAfter=87.0, instruction=Head east on Fulton Street, type=depart, modifier=null, exit=null}, voiceInstructions=[VoiceInstructions{distanceAlongGeometry=628.0, announcement=Head east on Fulton Street, then turn left onto 27th Avenue, ssmlAnnouncement=<speak><amazon:effect name="drc"><prosody rate="1.08">Head east on Fulton Street, then turn left onto <say-as interpret-as="address">27th</say-as> Avenue</prosody></amazon:effect></speak>}, VoiceInstructions{distanceAlongGeometry=149.3, announcement=Turn left onto 27th Avenue, ssmlAnnouncement=<speak><amazon:effect name="drc"><prosody rate="1.08">Turn left onto <say-as interpret-as="address">27th</say-as> Avenue</prosody></amazon:effect></speak>}], bannerInstructions=[BannerInstructions{distanceAlongGeometry=628.0, primary=BannerText{text=27th Avenue, components=[BannerComponents{text=27th Avenue, type=text, subType=null, abbreviation=27th Ave, abbreviationPriority=0, imageBaseUrl=null, imageUrl=null, directions=null, active=null}], type=turn, modifier=left, degrees=null, drivingSide=null}, secondary=null, sub=null, view=null}], drivingSide=right, weight=107.7, intersections=[StepIntersection{rawLocation=[-122.49348, 37.772151], bearings=[87], classes=null, entry=[true], in=null, out=0, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.492777, 37.772183], bearings=[0, 90, 270], classes=null, entry=[true, true, false], in=2, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.491708, 37.772232], bearings=[0, 90, 270], classes=null, entry=[true, true, false], in=2, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.490638, 37.772281], bearings=[0, 90, 270], classes=null, entry=[true, true, false], in=2, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.489565, 37.772329], bearings=[0, 90, 180, 270], classes=null, entry=[true, true, true, false], in=3, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.488492, 37.772378], bearings=[0, 90, 270], classes=null, entry=[true, true, false], in=2, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}, StepIntersection{rawLocation=[-122.487418, 37.772427], bearings=[0, 90, 270], classes=null, entry=[true, true, false], in=2, out=1, lanes=null, geometryIndex=null, isUrban=null, adminIndex=null, restStop=null, tollCollection=null, mapboxStreetsV8=null, tunnelName=null}], exits=null}, LegStep{distance=623.9, duration=72.3, durationTypical=null, speedLimitUnit=mph, speedLimitSign=mutcd, geometry=wjm`gAxc~rhFwl@hBiRj@eELag@|AiDJk
06-07 02:15:38.997: W/System.err(21218):    at org.junit.Assert.fail(Assert.java:89)
06-07 02:15:38.997: W/System.err(21218):    at org.junit.Assert.failNotEquals(Assert.java:835)
06-07 02:15:38.997: W/System.err(21218):    at org.junit.Assert.assertEquals(Assert.java:120)
06-07 02:15:38.997: W/System.err(21218):    at org.junit.Assert.assertEquals(Assert.java:146)
06-07 02:15:38.997: W/System.err(21218):    at com.mapbox.navigation.instrumentation_tests.ui.routeline.AlternativeRouteSelectionTest$selectAlternateRoute$1$2.onRouteProgressChanged(AlternativeRouteSelectionTest.kt:127)
06-07 02:15:38.997: W/System.err(21218):    at com.mapbox.navigation.core.trip.session.MapboxTripSession.updateRouteProgress(MapboxTripSession.kt:557)
06-07 02:15:38.997: W/System.err(21218):    at com.mapbox.navigation.core.trip.session.MapboxTripSession.access$updateRouteProgress(MapboxTripSession.kt:55)
06-07 02:15:38.997: W/System.err(21218):    at com.mapbox.navigation.core.trip.session.MapboxTripSession$navigatorObserver$1.onStatus(MapboxTripSession.kt:217)
06-07 02:15:38.997: W/System.err(21218):    at android.os.MessageQueue.nativePollOnce(Native Method)
06-07 02:15:38.997: W/System.err(21218):    at android.os.MessageQueue.next(MessageQueue.java:326)
06-07 02:15:38.997: W/System.err(21218):    at java.lang.reflect.Method.invoke(Native Method)
06-07 02:15:38.997: W/System.err(21218):    at androidx.test.espresso.base.Interrogator.getNextMessage(Interrogator.java:199)
06-07 02:15:38.997: W/System.err(21218):    at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:140)
06-07 02:15:38.997: W/System.err(21218):    at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:519)
06-07 02:15:38.997: W/System.err(21218):    at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:441)
06-07 02:15:38.997: W/System.err(21218):    at androidx.test.espresso.Espresso$1.run(Espresso.java:277)
06-07 02:15:38.997: W/System.err(21218):    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
06-07 02:15:38.997: W/System.err(21218):    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-07 02:15:38.997: W/System.err(21218):    at android.os.Handler.handleCallback(Handler.java:873)
06-07 02:15:38.998: W/System.err(21218):    at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 02:15:38.998: W/System.err(21218):    at android.os.Looper.loop(Looper.java:193)
06-07 02:15:38.998: W/System.err(21218):    at android.app.ActivityThread.main(ActivityThread.java:6718)
06-07 02:15:38.998: W/System.err(21218):    at java.lang.reflect.Method.invoke(Native Method)
06-07 02:15:38.998: W/System.err(21218):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
06-07 02:15:38.998: W/System.err(21218):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
06-07 02:15:39.000: E/libc++abi(21218): terminating with uncaught exception of type jni::PendingJavaException

Noting that It's not failing locally.

Guardiola31337 commented 3 years ago

Was able to reproduce locally.

2021-06-07 18:03:44.391 15905-15944/com.mapbox.navigation.instrumentation_tests E/PGS: PGS reroute_completes
2021-06-07 18:03:44.675 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INVALID
2021-06-07 18:03:44.873 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=TRACKING
2021-06-07 18:03:45.946 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=TRACKING
2021-06-07 18:03:46.943 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=TRACKING
2021-06-07 18:03:47.958 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=OFF_ROUTE

There's a crash after an unexpected OFF_ROUTE 👀

2021-06-07 18:03:47.958 15905-15905/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=OFF_ROUTE
2021-06-07 18:03:48.006 641-16049/? E/ResolverController: No valid NAT64 prefix (100, <unspecified>/0)
2021-06-07 18:03:48.006 832-832/? E/cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_adv_win_scale
2021-06-07 18:03:48.006 832-832/? E/cnss-daemon: wlan_service_update_sys_param: unable to open /proc/sys/net/ipv4/tcp_use_userconfig

    --------- beginning of crash
2021-06-07 18:03:48.096 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: FATAL EXCEPTION: MockWebServer TaskRunner
    Process: com.mapbox.navigation.instrumentation_tests, PID: 15905
    java.lang.Error: Request url:
    /directions/v5/mapbox/driving-traffic/-77.03195,38.896099;-77.030923,38.895433?access_token=pk.1234&geometries=polyline6&overview=full&steps=true&bearings=0%2C90%3B&continue_straight=true&annotations=congestion%2Cmaxspeed%2Cspeed%2Cduration%2Cdistance%2Cclosure&language=en&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=imperial&enable_refresh=true&sku=1083rxbyZc3f577850e0d18ee0564e7c138345b7e46
    is not handled.

    Available handlers:
2021-06-07 18:03:48.096 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: MockDirectionsRequestHandler(profile=driving-traffic, jsonResponse={"routes":[{"weight_typical":34.907,"duration_typical":24.001,"weight_name":"auto","weight":34.907,"duration":24.001,"distance":174.33,"legs":[{"admins":[{"iso_3166_1_alpha3":"USA","iso_3166_1":"US"}],"annotation":{"maxspeed":[{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true}],"congestion":["low","low","low","low","low"],"speed":[9.2,9.2,8.6,8.6,8.6],"distance":[70.1,10.7,17.8,43.9,31.2],"duration":[7.652,1.166,2.073,5.101,3.622]},"weight_typical":34.907,"duration_typical":24.001,"weight":34.907,"duration":24.001,"steps":[{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Drive north on 14th Street Northwest. Then Turn right onto Pennsylvania Avenue Northwest.</prosody></amazon:effect></speak>","announcement":"Drive north on 14th Street Northwest. Then Turn right onto Pennsylvania Avenue Northwest.","distanceAlongGeometry":81.33}],"intersections":[{"entry":[true],"bearings":[0],"duration":7.672,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":9.207,"geometry_index":0,"location":[-77.031953,38.894721]},{"bearings":[0,180],"entry":[true,false],"in":1,"turn_weight":2,"lanes":[{"indications":["left"],"valid":false,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":true}],"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":1,"location":[-77.03195,38.895351]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"Pennsylvania Avenue Northwest"}],"type":"turn","modifier":"right","text":"Pennsylvania Avenue Northwest"},"distanceAlongGeometry":81.33}],"speedLimitUnit":"mph","maneuver":{"type":"depart","instruction":"Drive north on 14th Street Northwest.","bearing_after":0,"bearing_before":0,"location":[-77.031953,38.894721]},"speedLimitSign":"mutcd","name":"14th Street Northwest","weight_typical":12.677,"duration_typical":8.879,"duration":8.879,"distance":81.33,"driving_side":"right","weight":12.677,"mode":"driving","geometry":"ag}diA``t|qCkf@E_E?"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">You have arrived at your destination.</prosody></amazon:effect></speak>","announcement":"You have arrived at your destination.","distanceAlongGeometry":79.167}],"intersections":[{"entry":[true,false],"in":1,"bearings":[91,180],"duration":6.405,"turn_weight":9,"turn_duration":4.315,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"weight":11.561,"geometry_index":2,"location":[-77.03195,38.895447]},{"entry":[true,false],"in":1,"bearings":[90,271],"duration":5.117,"turn_duration":0.007,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"weight":6.259,"geometry_index":3,"location":[-77.031744,38.895445]},{"bearings":[90,270],"entry":[true,false],"in":1,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":4,"location":[-77.031237,38.895445]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"You will arrive at your destination"}],"type":"arrive","modifier":"straight","text":"You will arrive at your destination"},"distanceAlongGeometry":93},{"primary":{"components":[{"type":"text","text":"You have arrived at your destination"}],"type":"arrive","modifier":"straight","text":"You have arrived at your destination"},"distanceAlongGeometry":79.167}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn right onto Pennsylvania Avenue Northwest.","modifier":"right","bearing_after":91,"bearing_before":0,"location":[-77.03195,38.895447]},"speedLimitSign":"mutcd","name":"Pennsylvania Avenue Northwest"
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: ,"weight_typical":22.23,"duration_typical":15.122,"duration":15.122,"distance":93,"driving_side":"right","weight":22.23,"mode":"driving","geometry":"mt~diAz_t|qCB{K?u^?oU"},{"voiceInstructions":[],"intersections":[{"bearings":[270],"entry":[true],"in":0,"admin_index":0,"geometry_index":5,"location":[-77.030877,38.895445]}],"bannerInstructions":[],"speedLimitUnit":"mph","maneuver":{"type":"arrive","instruction":"You have arrived at your destination.","bearing_after":0,"bearing_before":90,"location":[-77.030877,38.895445]},"speedLimitSign":"mutcd","name":"Pennsylvania Avenue Northwest","weight_typical":0,"duration_typical":0,"duration":0,"distance":0,"driving_side":"right","weight":0,"mode":"driving","geometry":"it~diAx|q|qC??"}],"distance":174.33,"summary":"14th Street Northwest, Pennsylvania Avenue Northwest"}],"geometry":"ag}diA``t|qCkf@E_E?B{K?u^?oU","voiceLocale":"en-US"}],"waypoints":[{"distance":3.318,"name":"14th Street Northwest","location":[-77.031953,38.894721]},{"distance":4.203,"name":"Pennsylvania Avenue Northwest","location":[-77.030877,38.895445]}],"code":"Ok","uuid":""}, expectedCoordinates=[Point{type=Point, bbox=null, coordinates=[-77.031991, 38.894721]}, Point{type=Point, bbox=null, coordinates=[-77.030923, 38.895433]}])
    MockVoiceRequestHandler(buffer=[size=31235 hex=49443304000000000023545353450000000f0000034c61766635382e34352e3130300000000000000000000000fff360c4001d7a85e84d431801025ec80008dc…], requestDetails=%3Cspeak%3E%3Camazon:effect%20name=%22drc%22%3E%3Cprosody%20rate=%221.08%22%3EDrive%20north%20on%2014th%20Street%20Northwest.%20Then%20Turn%20right%20onto%20Pennsylvania%20Avenue%20Northwest.%3C%2Fprosody%3E%3C%2)
    MockVoiceRequestHandler(buffer=[size=11173 hex=49443304000000000023545353450000000f0000034c61766635372e37312e3130300000000000000000000000fff360c4001c83c1e001461801888cb070185e…], requestDetails=%3Cspeak%3E%3Camazon:effect%20name=%22drc%22%3E%3Cprosody%20rate=%221.08%22%3EYou%20have%20arrived%20at%20your%20destination)
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: MockDirectionsRequestHandler(profile=driving-traffic, jsonResponse={"routes":[{"weight_typical":343.252,"duration_typical":195.672,"weight_name":"auto","weight":327.793,"duration":182.976,"distance":957.042,"legs":[{"admins":[{"iso_3166_1_alpha3":"USA","iso_3166_1":"US"}],"annotation":{"maxspeed":[{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true},{"unknown":true}],"congestion":["low","low","low","low","low","low","low","low","low","low","low","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","unknown","low","low","low","low","low","low","low","low"],"speed":[11.1,11.1,11.1,6.4,6.4,6.4,6.4,6.4,10,10,10,8.9,8.9,8.9,3.6,3.6,3.6,3.6,3.6,3.6,8.3,8.3,3.9,3.9,4.4,4.2,4.2,4.2,15,15,8.6,8.6,8.6],"distance":[26.9,31.1,12,13.8,67.9,105.1,1.2,14.8,11.5,111.7,12.3,13.6,40.4,14.1,9.4,12,6.9,12.8,15.1,36.9,8.2,8.7,10.9,26.5,52.3,8,77,14.7,77.8,10.7,17.8,43.9,31.2],"duration":[2.425,2.795,1.082,2.156,10.632,16.449,0.191,2.319,1.147,11.166,1.226,1.535,4.546,1.591,2.612,3.322,1.916,3.536,4.175,10.221,0.979,1.045,2.805,6.814,11.774,1.916,18.486,3.524,5.188,0.712,2.073,5.101,3.622]},"weight_typical":343.252,"duration_typical":195.672,"weight":327.793,"duration":182.976,"steps":[{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Drive north on 14th Street Northwest. Then Turn right onto F Street Northwest.</prosody></amazon:effect></speak>","announcement":"Drive north on 14th Street Northwest. Then Turn right onto F Street Northwest.","distanceAlongGeometry":70.042}],"intersections":[{"entry":[true],"bearings":[0],"duration":2.434,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":2.981,"geometry_index":0,"location":[-77.03195,38.896721]},{"entry":[true,false],"in":1,"bearings":[0,180],"duration":2.79,"turn_weight":0.5,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":3.918,"geometry_index":1,"location":[-77.03195,38.896963]},{"bearings":[0,180],"entry":[true,false],"in":1,"turn_weight":2,"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":2,"location":[-77.03195,38.897242]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"F Street Northwest"}],"type":"turn","modifier":"right","text":"F Street Northwest"},"distanceAlongGeometry":70.042}],"speedLimitUnit":"mph","maneuver":{"type":"depart","instruction":"Drive north on 14th Street Northwest.","bearing_after":0,"bearing_before":0,"location":[-77.03195,38.896721]},"speedLimitSign":"mutcd","name":"14th Street Northwest","weight_typical":12.153,"duration_typical":7.887,"duration":6.311,"distance":70.042,"driving_side":"right","weight":10.222,"mode":"driving","geometry":"adaeiAz_t|qCcN?mP?wE?"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In 700 feet, Turn right onto 13th Street Northwest.</prosody></amazon:effect></speak>","announcement":"In 700 feet, Turn right onto 13th Street Northwest.","distanceAlongGeometry":186.667},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto 13th Street Northwest.</prosody></amazon:effect></speak>","announcement":"Turn right onto 13th Street Northwest.","distanceAlongGeometry":87.111}],"intersections":[{"entry":[true,false],"in":1,"bearings":[90,180],"duration":6.297,"turn_weight":8,"turn_duration":4.105,"mapbox
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: _streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":10.684,"geometry_index":3,"location":[-77.03195,38.89735]},{"entry":[true,false],"in":1,"bearings":[90,270],"duration":27.085,"turn_weight":2,"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":35.171,"geometry_index":4,"location":[-77.031791,38.89735]},{"bearings":[90,270],"entry":[true,false],"in":1,"turn_weight":2,"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":6,"location":[-77.029794,38.897346]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"13th Street Northwest"}],"type":"turn","modifier":"right","text":"13th Street Northwest"},"distanceAlongGeometry":203}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn right onto F Street Northwest.","modifier":"right","bearing_after":90,"bearing_before":0,"location":[-77.03195,38.89735]},"speedLimitSign":"mutcd","name":"F Street Northwest","weight_typical":50.923,"duration_typical":35.893,"duration":35.893,"distance":203,"driving_side":"right","weight":50.923,"mode":"driving","geometry":"kkbeiAz_t|qC?}H@_p@DyjA?[?uI"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">In 700 feet, Turn right onto Pennsylvania Avenue Northwest.</prosody></amazon:effect></speak>","announcement":"In 700 feet, Turn right onto Pennsylvania Avenue Northwest.","distanceAlongGeometry":186.667},{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto Pennsylvania Avenue Northwest. Then Turn left onto 13½th Street Northwest.</prosody></amazon:effect></speak>","announcement":"Turn right onto Pennsylvania Avenue Northwest. Then Turn left onto 13½th Street Northwest.","distanceAlongGeometry":107.528}],"intersections":[{"entry":[true,false],"in":1,"bearings":[180,270],"duration":5.205,"turn_weight":8,"turn_duration":4.105,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":9.347,"geometry_index":8,"location":[-77.029609,38.897346]},{"entry":[false,true],"in":0,"bearings":[0,179],"duration":11.219,"turn_weight":2,"turn_duration":0.019,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":1,"weight":15.72,"geometry_index":9,"location":[-77.02961,38.897243]},{"entry":[true,false],"in":1,"bearings":[182,359],"duration":1.208,"turn_weight":2,"turn_duration":0.008,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":3.44,"geometry_index":10,"location":[-77.029594,38.89624]},{"entry":[false,true],"in":0,"bearings":[2,207],"duration":3.615,"turn_weight":2,"turn_duration":2.04,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":1,"weight":3.89,"geometry_index":11,"location":[-77.0296,38.89613]},{"entry":[false,true],"in":0,"bearings":[27,180],"duration":4.642,"turn_weight":2,"turn_duration":0.142,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":1,"weight":7.4,"geometry_index":12,"location":[-77.029672,38.896021]},{"bearings":[0,180],"entry":[false,true],"in":0,"turn_weight":2,"lanes":[{"indications":["left"],"valid":false,"active":false},{"indications":["left"],"valid":false,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":true}],"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":1,"geometry_index":13,"location":[-77.029672,38.895658]}],"bannerInstructions":[{"sub":{"components":[{"type":"text","text":"13½th Street Northwest"}],"type":"turn","modifier":"left","text":"13½th Street Northwest"},"primary":{"components":[{"type":"text","text":"Pennsylvania Avenue Northwest"}],"type":"turn","modifier":"right","text":"Pennsylvania Avenue Northwest"},"distanceAlongGeometry":203}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn ri
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: ght onto 13th Street Northwest.","modifier":"right","bearing_after":180,"bearing_before":90,"location":[-77.029609,38.897346]},"speedLimitSign":"mutcd","name":"13th Street Northwest","weight_typical":53.018,"duration_typical":35.101,"duration":27.471,"distance":203,"driving_side":"right","weight":43.688,"mode":"driving","geometry":"ckbeiApmo|qClE@t}@_@zEJxEnCtU?|FA"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn left onto 13½th Street Northwest. Then Turn right onto D Street Northwest.</prosody></amazon:effect></speak>","announcement":"Turn left onto 13½th Street Northwest. Then Turn right onto D Street Northwest.","distanceAlongGeometry":74}],"intersections":[{"entry":[false,true],"in":0,"bearings":[0,287],"duration":8.618,"turn_weight":9,"turn_duration":6.126,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":1,"weight":11.991,"geometry_index":14,"location":[-77.029671,38.895531]},{"entry":[false,true],"in":0,"bearings":[107,281],"duration":5.288,"turn_duration":0.026,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":1,"weight":6.314,"geometry_index":15,"location":[-77.029775,38.895556]},{"entry":[false,true],"in":0,"bearings":[101,274],"duration":3.6,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":1,"weight":4.32,"geometry_index":17,"location":[-77.029989,38.895589]},{"bearings":[94,270],"entry":[false,true],"in":0,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":1,"geometry_index":18,"location":[-77.030136,38.895597]}],"bannerInstructions":[{"sub":{"components":[{"active_direction":"left","active":true,"directions":["left"],"type":"lane","text":""},{"active":false,"directions":["straight"],"type":"lane","text":""},{"active":false,"directions":["straight"],"type":"lane","text":""}],"text":""},"primary":{"components":[{"type":"text","text":"13½th Street Northwest"}],"type":"turn","modifier":"left","text":"13½th Street Northwest"},"distanceAlongGeometry":93}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn right onto Pennsylvania Avenue Northwest.","modifier":"right","bearing_after":287,"bearing_before":180,"location":[-77.029671,38.895531]},"speedLimitSign":"mutcd","name":"Pennsylvania Avenue Northwest","weight_typical":40.265,"duration_typical":31.906,"duration":31.906,"distance":93,"driving_side":"right","weight":40.265,"mode":"driving","geometry":"uy~diAlqo|qCq@nEo@lGQ|COdH@zI@rY"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto D Street Northwest. Then Turn right onto 14th Street Northwest.</prosody></amazon:effect></speak>","announcement":"Turn right onto D Street Northwest. Then Turn right onto 14th Street Northwest.","distanceAlongGeometry":65.833}],"intersections":[{"lanes":[{"indications":["left"],"valid_indication":"left","valid":true,"active":true},{"indications":["straight"],"valid":false,"active":false},{"indications":["straight"],"valid":false,"active":false}],"location":[-77.030736,38.895595],"geometry_index":20,"admin_index":0,"weight":10.176,"is_urban":true,"mapbox_streets_v8":{"class":"street"},"turn_duration":5.048,"turn_weight":9,"duration":6.008,"bearings":[90,197],"out":1,"in":0,"entry":[false,true]},{"entry":[false,true],"in":0,"bearings":[17,194],"duration":3.102,"turn_weight":21,"turn_duration":2.022,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_index":0,"out":1,"weight":22.323,"geometry_index":21,"location":[-77.030764,38.895525]},{"entry":[false,true],"in":0,"bearings":[14,180],"duration":4.881,"turn_weight":42,"turn_duration":2.052,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_index":0,"out":1,"weight":45.465,"geometry_index":22,"location":[-77.030788,38.895449]},{"entry":[false,true],"in":0,"bearings":[0,181],"duration":6.694,"turn_weight":2,"turn_duration":0.008,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_i
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: ndex":0,"out":1,"weight":10.023,"geometry_index":23,"location":[-77.030788,38.895351]},{"bearings":[1,181],"entry":[false,true],"in":0,"turn_weight":0.5,"turn_duration":0.007,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_index":0,"out":1,"geometry_index":24,"location":[-77.030793,38.895113]}],"bannerInstructions":[{"sub":{"components":[{"type":"text","text":"14th Street Northwest"}],"type":"turn","modifier":"right","text":"14th Street Northwest"},"primary":{"components":[{"type":"text","text":"D Street Northwest"}],"type":"turn","modifier":"right","text":"D Street Northwest"},"distanceAlongGeometry":106}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn left onto 13½th Street Northwest.","modifier":"left","bearing_after":197,"bearing_before":270,"location":[-77.030736,38.895595]},"speedLimitSign":"mutcd","name":"13½th Street Northwest","weight_typical":102.527,"duration_typical":32.392,"duration":32.392,"distance":106,"driving_side":"right","weight":102.527,"mode":"driving","geometry":"u}~diA~sq|qCjCv@vCn@bE?zMHj\\R"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto 14th Street Northwest. Then Turn right onto Pennsylvania Avenue Northwest.</prosody></amazon:effect></speak>","announcement":"Turn right onto 14th Street Northwest. Then Turn right onto Pennsylvania Avenue Northwest.","distanceAlongGeometry":65.833}],"intersections":[{"entry":[false,true],"in":0,"bearings":[1,272],"duration":22.608,"turn_weight":8,"turn_duration":2.208,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_index":0,"out":1,"weight":32.48,"geometry_index":25,"location":[-77.030803,38.894643]},{"bearings":[90,274],"entry":[false,true],"in":0,"turn_weight":2,"turn_duration":0.01,"mapbox_streets_v8":{"class":"street"},"is_urban":true,"admin_index":0,"out":1,"geometry_index":27,"location":[-77.031784,38.894642]}],"bannerInstructions":[{"sub":{"components":[{"type":"text","text":"Pennsylvania Avenue Northwest"}],"type":"turn","modifier":"right","text":"Pennsylvania Avenue Northwest"},"primary":{"components":[{"type":"text","text":"14th Street Northwest"}],"type":"turn","modifier":"right","text":"14th Street Northwest"},"distanceAlongGeometry":100}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn right onto D Street Northwest.","modifier":"right","bearing_after":272,"bearing_before":181,"location":[-77.030803,38.894643]},"speedLimitSign":"mutcd","name":"D Street Northwest","weight_typical":38.8,"duration_typical":26.218,"duration":26.218,"distance":100,"driving_side":"right","weight":38.8,"mode":"driving","geometry":"eb}diAdxq|qCGvDHpv@SpI"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">Turn right onto Pennsylvania Avenue Northwest. Then You will arrive at your destination.</prosody></amazon:effect></speak>","announcement":"Turn right onto Pennsylvania Avenue Northwest. Then You will arrive at your destination.","distanceAlongGeometry":72.667}],"intersections":[{"entry":[true,false],"in":1,"bearings":[0,94],"duration":6.923,"turn_weight":10,"turn_duration":1.723,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"weight":16.24,"geometry_index":28,"location":[-77.031953,38.894652]},{"bearings":[0,180],"entry":[true,false],"in":1,"turn_weight":2,"lanes":[{"indications":["left"],"valid":false,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":false},{"indications":["straight"],"valid_indication":"straight","valid":true,"active":true}],"turn_duration":0.007,"mapbox_streets_v8":{"class":"secondary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":29,"location":[-77.03195,38.895351]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"Pennsylvania Avenue Northwest"}],"type":"turn","modifier":"right","text":"P
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime: ennsylvania Avenue Northwest"},"distanceAlongGeometry":89}],"speedLimitUnit":"mph","maneuver":{"type":"end of road","instruction":"Turn right onto 14th Street Northwest.","modifier":"right","bearing_after":0,"bearing_before":274,"location":[-77.031953,38.894652]},"speedLimitSign":"mutcd","name":"14th Street Northwest","weight_typical":23.337,"duration_typical":11.154,"duration":7.663,"distance":89,"driving_side":"right","weight":19.138,"mode":"driving","geometry":"wb}diA``t|qCuj@E_E?"},{"voiceInstructions":[{"ssmlAnnouncement":"<speak><amazon:effect name=\"drc\"><prosody rate=\"1.08\">You have arrived at your destination.</prosody></amazon:effect></speak>","announcement":"You have arrived at your destination.","distanceAlongGeometry":79.167}],"intersections":[{"entry":[true,false],"in":1,"bearings":[91,180],"duration":6.405,"turn_weight":9,"turn_duration":4.315,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"weight":11.561,"geometry_index":30,"location":[-77.03195,38.895447]},{"entry":[true,false],"in":1,"bearings":[90,271],"duration":5.117,"turn_duration":0.007,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"weight":6.259,"geometry_index":31,"location":[-77.031744,38.895445]},{"bearings":[90,270],"entry":[true,false],"in":1,"mapbox_streets_v8":{"class":"primary"},"is_urban":true,"admin_index":0,"out":0,"geometry_index":32,"location":[-77.031237,38.895445]}],"bannerInstructions":[{"primary":{"components":[{"type":"text","text":"You will arrive at your destination"}],"type":"arrive","modifier":"straight","text":"You will arrive at your destination"},"distanceAlongGeometry":93},{"primary":{"components":[{"type":"text","text":"You have arrived at your destination"}],"type":"arrive","modifier":"straight","text":"You have arrived at your destination"},"distanceAlongGeometry":79.167}],"speedLimitUnit":"mph","maneuver":{"type":"turn","instruction":"Turn right onto Pennsylvania Avenue Northwest.","modifier":"right","bearing_after":91,"bearing_before":0,"location":[-77.03195,38.895447]},"speedLimitSign":"mutcd","name":"Pennsylvania Avenue Northwest","weight_typical":22.23,"duration_typical":15.122,"duration":15.122,"distance":93,"driving_side":"right","weight":22.23,"mode":"driving","geometry":"mt~diAz_t|qCB{K?u^?oU"},{"voiceInstructions":[],"intersections":[{"bearings":[270],"entry":[true],"in":0,"admin_index":0,"geometry_index":33,"location":[-77.030877,38.895445]}],"bannerInstructions":[],"speedLimitUnit":"mph","maneuver":{"type":"arrive","instruction":"You have arrived at your destination.","bearing_after":0,"bearing_before":90,"location":[-77.030877,38.895445]},"speedLimitSign":"mutcd","name":"Pennsylvania Avenue Northwest","weight_typical":0,"duration_typical":0,"duration":0,"distance":0,"driving_side":"right","weight":0,"mode":"driving","geometry":"it~diAx|q|qC??"}],"distance":957.042,"summary":"F Street Northwest, 13th Street Northwest"}],"geometry":"adaeiAz_t|qCcN?mP?wE??}H@_p@DyjA?[?uIlE@t}@_@zEJxEnCtU?|FAq@nEo@lGQ|COdH@zI@rYjCv@vCn@bE?zMHj\\RGvDHpv@SpIuj@E_E?B{K?u^?oU","voiceLocale":"en-US"}],"waypoints":[{"distance":3.551,"name":"14th Street Northwest","location":[-77.03195,38.896721]},{"distance":4.203,"name":"Pennsylvania Avenue Northwest","location":[-77.030877,38.895445]}],"code":"Ok","uuid":""}, expectedCoordinates=[Point{type=Point, bbox=null, coordinates=[-77.031991, 38.896721]}, Point{type=Point, bbox=null, coordinates=[-77.030923, 38.895433]}])

        at com.mapbox.navigation.testing.ui.http.MockWebServerRule$1.dispatch(MockWebServerRule.kt:46)
        at okhttp3.mockwebserver.MockWebServer$SocketHandler.processOneRequest(MockWebServer.kt:600)
        at okhttp3.mockwebserver.MockWebServer$SocketHandler.handle(MockWebServer.kt:551)
        at okhttp3.mockwebserver.MockWebServer$serveConnection$$inlined$execute$1.runOnce(TaskQueue.kt:220)
        at okhttp3.internal.concurrent.TaskRunner.runTask(TaskRunner.kt:116)
        at okhttp3.internal.concurrent.TaskRunner.access$runTask(TaskRunner.kt:42)
2021-06-07 18:03:48.097 15905-16050/com.mapbox.navigation.instrumentation_tests E/AndroidRuntime:     at okhttp3.internal.concurrent.TaskRunner$runnable$1.run(TaskRunner.kt:65)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
2021-06-07 18:03:48.103 15905-16050/com.mapbox.navigation.instrumentation_tests I/Process: Sending signal. PID: 15905 SIG: 9
2021-06-07 18:03:48.106 945-16054/? I/DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
2021-06-07 18:03:48.116 945-1115/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
2021-06-07 18:03:48.116 945-1115/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
2021-06-07 18:03:48.161 945-1387/? W/InputDispatcher: channel 'd85ce05 com.mapbox.navigation.instrumentation_tests/com.mapbox.navigation.instrumentation_tests.activity.EmptyTestActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
2021-06-07 18:03:48.161 945-1387/? E/InputDispatcher: channel 'd85ce05 com.mapbox.navigation.instrumentation_tests/com.mapbox.navigation.instrumentation_tests.activity.EmptyTestActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2021-06-07 18:03:52.903 16107-16149/com.mapbox.navigation.instrumentation_tests E/PGS: PGS expect_faster_route_alternatives
2021-06-07 18:03:53.451 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=OFF_ROUTE
2021-06-07 18:03:53.478 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=TRACKING
2021-06-07 18:03:53.726 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:54.357 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:55.336 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:56.500 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:57.441 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:58.383 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:03:59.420 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:04:00.436 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:04:01.376 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:04:02.405 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED
2021-06-07 18:04:03.425 16107-16107/com.mapbox.navigation.instrumentation_tests E/PGS: PGS navigationStatus=INITIALIZED

Here, there's an AssertionError also due to an unexpected OFF_ROUTE 👀

2021-06-07 18:04:03.986 16107-16149/com.mapbox.navigation.instrumentation_tests E/TestRunner: failed: expect_faster_route_alternatives(com.mapbox.navigation.instrumentation_tests.core.RouteAlternativesTest)
2021-06-07 18:04:03.986 16107-16149/com.mapbox.navigation.instrumentation_tests E/TestRunner: ----- begin exception -----
2021-06-07 18:04:03.987 16107-16149/com.mapbox.navigation.instrumentation_tests E/TestRunner: java.lang.AssertionError
        at org.junit.Assert.fail(Assert.java:87)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertTrue(Assert.java:53)
        at com.mapbox.navigation.instrumentation_tests.core.RouteAlternativesTest.expect_faster_route_alternatives(RouteAlternativesTest.kt:81)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at androidx.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:134)
        at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
        at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
        at com.schibsted.spain.barista.rule.cleardata.ClearDatabaseRule$apply$1.evaluate(ClearDatabaseRule.kt:30)
        at com.schibsted.spain.barista.rule.cleardata.ClearPreferencesRule$1.evaluate(ClearPreferencesRule.java:26)
        at com.schibsted.spain.barista.rule.cleardata.ClearFilesRule$apply$1.evaluate(ClearFilesRule.kt:25)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.junit.runners.Suite.runChild(Suite.java:128)
        at org.junit.runners.Suite.runChild(Suite.java:27)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
        at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
        at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
        at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2196)
2021-06-07 18:04:03.987 16107-16149/com.mapbox.navigation.instrumentation_tests E/TestRunner: ----- end exception -----

@DmitryAk @mskurydin Can you think of any reasons why switching to callback approach (https://github.com/mapbox/mapbox-navigation-android/pull/4419) could cause these unexpected OFF_ROUTEs?

DmitryAk commented 3 years ago

@Guardiola31337 I don't see how this error could be related to callback approach. at com.mapbox.navigation.testing.ui.http.MockWebServerRule$1.dispatch(MockWebServerRule.kt:46) - what is this MockWebServer ? As I can understand, it is failing because of missing handler /directions/v5/mapbox/driving-traffic/-77.03195,38.896099;-77.030923,38.895433?access_token=pk.1234&geometries=polyline6&overview=full&steps=true&bearings=0%2C90%3B&continue_straight=true&annotations=congestion%2Cmaxspeed%2Cspeed%2Cduration%2Cdistance%2Cclosure&language=en&roundabout_exits=true&voice_instructions=true&banner_instructions=true&voice_units=imperial&enable_refresh=true&sku=1083rxbyZc3f577850e0d18ee0564e7c138345b7e46 is not handled. Maybe, it is required to review the test and mock handlers?

Guardiola31337 commented 3 years ago

@DmitryAk if there's a reroute request then that won't be handled by the mock web server, the problem is why are these unexpected off-routes happening while they don't in main i.e. callback vs polling approach 🤔

Guardiola31337 commented 3 years ago

Tested multiple times on main and this is what I got:

2021-06-08 13:37:24.224 32306-32345/com.mapbox.navigation.instrumentation_tests E/PGS: PGS reroute_completes
2021-06-08 13:37:24.477 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INVALID
2021-06-08 13:37:24.481 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INVALID
2021-06-08 13:37:24.619 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:25.688 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:26.674 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:27.767 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=OFF_ROUTE
2021-06-08 13:37:28.050 32306-32306/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING

2021-06-08 13:37:33.283 32488-32527/com.mapbox.navigation.instrumentation_tests E/PGS: PGS expect_faster_route_alternatives
2021-06-08 13:37:33.839 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:33.848 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:33.856 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:34.677 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:35.696 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:36.893 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:37.782 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:38.700 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:39.724 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:40.742 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:42.702 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:37:43.718 32488-32488/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING

So the issue is for reroute_completes is a missing TRACKING and then an unexpected OFF_ROUTE for expect_faster_route_alternatives (also look at the diff between INITIALIZED vs TRACKING).

Noting that I was able to repro the reroute_completes failure but not the expect_faster_route_alternatives. Similar logs as above:

2021-06-08 13:45:47.690 5870-5909/com.mapbox.navigation.instrumentation_tests E/PGS: PGS reroute_completes
2021-06-08 13:45:47.925 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INVALID
2021-06-08 13:45:47.929 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INVALID
2021-06-08 13:45:48.065 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:49.132 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:50.161 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:51.224 5870-5870/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=OFF_ROUTE
2021-06-08 13:45:55.843 6041-6082/com.mapbox.navigation.instrumentation_tests E/PGS: PGS expect_faster_route_alternatives
2021-06-08 13:45:56.405 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:56.419 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:57.344 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:58.313 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:45:59.319 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:00.418 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:01.286 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:02.333 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:03.316 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:05.278 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-08 13:46:06.351 6041-6041/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING

cc @DmitryAk @mskurydin @SiarheiFedartsou

Guardiola31337 commented 3 years ago

Rebased https://github.com/mapbox/mapbox-navigation-android/pull/4419 from main and can't reproduce consistently locally anymore 🤔

Now I'm getting that TRACKING status, most of the times...

2021-06-14 14:50:52.011 32005-32045/com.mapbox.navigation.instrumentation_tests E/PGS: PGS reroute_completes
2021-06-14 14:50:52.347 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INVALID
2021-06-14 14:50:52.539 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-14 14:50:53.578 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-14 14:50:54.571 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
2021-06-14 14:50:55.613 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=OFF_ROUTE
2021-06-14 14:50:55.905 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INITIALIZED
2021-06-14 14:50:56.596 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INITIALIZED
2021-06-14 14:50:58.613 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=INITIALIZED
2021-06-14 14:50:59.600 32005-32005/com.mapbox.navigation.instrumentation_tests E/PGS: PGS routeState=TRACKING
Guardiola31337 commented 3 years ago

Rebased https://github.com/mapbox/mapbox-navigation-android/pull/4419 from main and can't reproduce consistently locally anymore 🤔

https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/8865001394225981595/executions/bs.a18096e1a239f8b4

CI didn't reproduce reroute_completes expect_faster_route_alternatives failures. It reproduced https://github.com/mapbox/mapbox-navigation-android/issues/4429#issuecomment-855772383 which is also failing sometimes in other PRs targeting main.

mskurydin commented 3 years ago

Can we capture a history recording for the test?

This would give us the full context and allow to understand the reasons behind the off-route. The initialized state after off-route may mean we are a bit too far from the route (but not too far). My guess - there is a map-matching error and we snap to some edge that is quite far. The SDK takes the location from this enhanced location as the origin for a new route. After the route is set, it takes a few seconds to reach some location on a new route.

Guardiola31337 commented 3 years ago

Experimented a bit on how to make reroute_completes more robust and deterministic in https://github.com/mapbox/mapbox-navigation-android/tree/pg-core-reroute-test-refactor

Current problem:

We should refactor these tests and how MockWebServer handles internal requests for these kind of scenarios. Let's use this ticket to keep track of this work.

Guardiola31337 commented 3 years ago

Noting that RouteAlternativesTest AssertionError was addressed by https://github.com/mapbox/mapbox-navigation-android/pull/4527 Going to change OP description to reflect what's this ticket tracking now.

cc @kmadsen

Guardiola31337 commented 3 years ago

@kmadsen BTW rebased https://github.com/mapbox/mapbox-navigation-android/pull/4419 from main after https://github.com/mapbox/mapbox-navigation-android/pull/4527 and test failed again https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/4668431245650952651/executions/bs.6e9713f03e37489e/testcases/3

Guardiola31337 commented 3 years ago

@kmadsen Another instance of expect_faster_route_alternatives test failing https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/8780689655655725505/executions/bs.fd5511d87b59e88f/testcases/3/errors

Guardiola31337 commented 3 years ago

Noting that reroute_completes failed in https://github.com/mapbox/mapbox-navigation-android/pull/4558 https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/8537049470456065458/executions/bs.efc3cbfd1f5101bb/testcases/1/logs

Guardiola31337 commented 3 years ago

Interesting 🤔

Run into verify_history_files_are_recorded_and_readable test failure https://console.firebase.google.com/u/0/project/mapbox-navigation-android/testlab/histories/bh.54eb2dd57e959221/matrices/6580013920275794138/executions/bs.996e4138806a0416/testcases/2/errors (https://github.com/mapbox/mapbox-navigation-android/pull/4482 https://app.circleci.com/pipelines/github/mapbox/mapbox-navigation-android/12577/workflows/661a4eec-4908-4c14-bf88-a6744ae22de2/jobs/51374)

cc @kmadsen