Skip to content

Commit

Permalink
test: fix OutOfMemoryError: Java heap space
Browse files Browse the repository at this point in the history
on macos:

```
at com.ichi2.anki.dialogs.CreateDeckDialogTest.setUp(CreateDeckDialogTest.kt:52)

Caused by:
java.lang.OutOfMemoryError: Java heap space
    at java.desktop/java.awt.image.DataBufferInt.<init>(DataBufferInt.java:77)
    at java.desktop/java.awt.image.Raster.createPackedRaster(Raster.java:538)
    at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
    at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:333)
    at org.robolectric.shadows.ShadowBitmapFactory.create(ShadowBitmapFactory.java:287)
    at org.robolectric.shadows.ShadowBitmapFactory.decodeStream(ShadowBitmapFactory.java:189)
    at org.robolectric.shadows.ShadowBitmapFactory.decodeStream(ShadowBitmapFactory.java:153)
```

https://redirect.github.com/ankidroid/Anki-Android/pull/15520#issuecomment-1948416566
  • Loading branch information
david-allison committed Feb 16, 2024
1 parent 5659b80 commit 1113858
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.ichi2.anki.dialogs.CreateDeckDialog.DeckDialogType
import com.ichi2.anki.dialogs.utils.input
import com.ichi2.libanki.DeckId
import com.ichi2.utils.positiveButton
import okhttp3.internal.closeQuietly
import org.hamcrest.CoreMatchers.equalTo
import org.hamcrest.MatcherAssert.*
import org.junit.Test
Expand All @@ -54,6 +55,11 @@ class CreateDeckDialogTest : RobolectricTest() {
}
}

override fun tearDown() {
super.tearDown()
activityScenario.closeQuietly()
}

@Test
fun testCreateFilteredDeckFunction() {
val deckName = "filteredDeck"
Expand Down

0 comments on commit 1113858

Please sign in to comment.