Skip to content

Conversation

@LukasPaczos
Copy link
Contributor

Fixes #558.

This PR adds a bunch of stress tests that are trying to push as much data as possible while we are reloading the style. Those tests caught a bunch of issues, which are handled with additional state flags and by always using core references to sources and layers instead of local ones.

Let me know if the documentation around state flags is clear enough.

/cc @tobrun for eyes at espresso + map testing

@LukasPaczos LukasPaczos added the location-layer-plugin Issues that deal with the location layer module label Jul 3, 2018
@LukasPaczos LukasPaczos added this to the location-layer-0.6.0 milestone Jul 3, 2018
@LukasPaczos LukasPaczos requested a review from danesfeder July 3, 2018 12:42
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is looking great! just some minor questions/remarks

Assert.assertThat(plugin.locationEngine, nullValue())
Assert.assertEquals(point.latitude(), location.latitude, 0.1)
Assert.assertEquals(point.longitude(), location.longitude, 0.1)
assertThat(plugin.locationEngine, nullValue())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this equivalent to assertNull(plugin.locationEgine)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and since that was the approach taken with this test suite before I took over, I think I'm going to stick with it. Going to do some cleanups of those assertions though.

Assert.assertEquals(point.latitude(), location.latitude, 0.1)
Assert.assertEquals(point.longitude(), location.longitude, 0.1)
assertThat(plugin.locationEngine, nullValue())
assertEquals(point.latitude(), location.latitude, 0.1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selected delta atm: The first decimal place is worth up to 11.1 km: it can distinguish the position of one large city from a neighboring large city. I feel this can be made more accurate:

For example: The third decimal place is worth up to 110 m: it can identify a large agricultural field or institutional campus. or
The fourth decimal place is worth up to 11 m: it can identify a parcel of land. It is comparable to the typical accuracy of an uncorrected GPS unit with no interference.

https://gis.stackexchange.com/questions/8650/measuring-accuracy-of-latitude-and-longitude

Copy link
Contributor Author

@LukasPaczos LukasPaczos Jul 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My testing revealed, that when zoomed out to approximately 0 the precision can be around two decimal points. For the test not to be flaky, I'm just checking if the point is in a general position of the forced location, as they are mostly being moved from the infinity anyway, leaving the responsibility of precise rendering to the Maps SDK.

plugin.isLocationLayerEnabled = false
uiController.loopMainThreadForAtLeast(MAP_RENDER_DELAY)
assertThat(mapboxMap.queryLocationSourceFeatures(LOCATION_SOURCE).isEmpty(), `is`(true))
assertThat(mapboxMap.querySourceFeatures(LOCATION_SOURCE).isEmpty(), `is`(true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this equivalent to assertTrue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #568 (comment).

Copy link
Contributor

@danesfeder danesfeder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me after remaining comment from @tobrun are addressed.

Per chat with @LukasPaczos, this PR introduces booleans for both the Android lifecycle as well as the map lifecycle 👍

@LukasPaczos LukasPaczos force-pushed the 558-native-crash-on-style-reload branch from 4bad0d6 to d11b44f Compare July 6, 2018 11:16
@LukasPaczos LukasPaczos merged commit 65147bb into master Jul 6, 2018
@LukasPaczos LukasPaczos deleted the 558-native-crash-on-style-reload branch July 6, 2018 12:32
@danesfeder danesfeder mentioned this pull request Jul 9, 2018
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

location-layer-plugin Issues that deal with the location layer module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants