Reduce noise of flaky test.

This commit is contained in:
Greyson Parrelli
2024-08-15 09:29:43 -04:00
committed by mtang-signal
parent 627b939326
commit 630875dae2
4 changed files with 97 additions and 0 deletions

View File

@@ -4,9 +4,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.signal.core.util.concurrent.SignalExecutors
import org.thoughtcrime.securesms.testing.SignalFlakyTest
import org.thoughtcrime.securesms.testing.SignalFlakyTestRule
import java.util.concurrent.CountDownLatch
import java.util.concurrent.atomic.AtomicBoolean
@@ -18,6 +21,9 @@ class SQLiteDatabaseTest {
private lateinit var db: SQLiteDatabase
@get:Rule
val flakyTestRule = SignalFlakyTestRule()
@Before
fun setup() {
db = SignalDatabase.instance!!.signalWritableDatabase
@@ -181,6 +187,7 @@ class SQLiteDatabaseTest {
assertTrue(hasRun2.get())
}
@SignalFlakyTest
@Test
fun runPostSuccessfulTransaction_runsAfterMainTransactionInNestedTransaction() {
val hasRun1 = AtomicBoolean(false)