Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Snapshotter tests #281

Closed
tobrun opened this issue Mar 17, 2020 · 2 comments
Closed

Snapshotter tests #281

tobrun opened this issue Mar 17, 2020 · 2 comments

Comments

@tobrun
Copy link
Member

tobrun commented Mar 17, 2020

We disabled snapshotter testing due to flaky results. With upstream changes related to the thread setup of snasphotter, we should re-enable them.

@alexshalamov
Copy link
Contributor

alexshalamov commented Mar 17, 2020

@tobrun I checked test and I see that JVM kills snapshotter object before snapshot is made.

diff --git a/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotterTest.kt b/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotterTest.kt
index 1676566..8d689d0 100644
--- a/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotterTest.kt
+++ b/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotterTest.kt
@@ -20,7 +20,6 @@ import org.junit.runner.RunWith
  * Integration test that validates if a snapshotter creation
  */
 @RunWith(AndroidJUnit4::class)
-@Ignore("Ignored until https://github.com/mapbox/mapbox-gl-native/issues/11669 is resolved.")
 class MapSnapshotterTest {

   @Rule
@@ -31,6 +30,7 @@ class MapSnapshotterTest {

   @Test
   fun mapSnapshotter() {
+    var mapSnapshotter: MapSnapshotter? = null
     rule.activity.runOnUiThread {
       val options = MapSnapshotter.Options(512, 512)
         .withPixelRatio(1.0f)
@@ -41,8 +41,8 @@ class MapSnapshotterTest {
             .target(LatLng(51.145495, 5.742234))
             .build()
         )
-      val mapSnapshotter = MapSnapshotter(rule.activity, options)
-      mapSnapshotter.start({
+      mapSnapshotter = MapSnapshotter(rule.activity, options)
+      mapSnapshotter?.start({
         assertNotNull(it)
         assertNotNull(it.bitmap)
         countDownLatch.countDown()

@Chaoba
Copy link
Contributor

Chaoba commented Mar 19, 2020

Fixed in #268. Close.

@Chaoba Chaoba closed this as completed Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants