Skip to content

Commit

Permalink
Bump test timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Oct 3, 2023
1 parent c6b917e commit 25f4fe4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import kotlinx.coroutines.runBlocking
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.time.Duration.Companion.seconds

abstract class RekeyTest: TestHelperNonEphemeral() {

Expand Down Expand Up @@ -58,7 +59,7 @@ abstract class RekeyTest: TestHelperNonEphemeral() {
testLogger("RUN - ${i++}")

// db files automatically delete once runMCDriverTest completes.
runDriverTest(key1, filesystem) { factory, driver ->
runDriverTest(key1, filesystem, timeout = 20.seconds) { factory, driver ->
val expected = "4314tlkjansd"
driver.upsert("key", expected)
assertEquals(expected, driver.get("key"))
Expand All @@ -78,7 +79,8 @@ abstract class RekeyTest: TestHelperNonEphemeral() {
@Test
open fun givenConfig_whenMigrations_thenRekeyedToNewestEncryptionConfig() = runDriverTest(
key = keyPassphrase,
filesystem = { encryption { chaCha20 { sqleet() } } }
filesystem = { encryption { chaCha20 { sqleet() } } },
timeout = 25.seconds,
) { factory1, driver ->
val dbName = factory1.config.dbName

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import okio.FileSystem
import okio.IOException
import okio.Path.Companion.toPath
import kotlin.random.Random
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds

internal expect fun filesystem(): FileSystem

Expand All @@ -39,8 +41,9 @@ abstract class TestHelperNonEphemeral: TestHelperBase() {
// pass null to use in memory db
filesystem: (FilesystemConfig.Builder.() -> Unit) = {},
testLogger: ((String) -> Unit)? = this.testLogger,
timeout: Duration = 10.seconds,
block: suspend TestScope.(factory: SQLiteMCDriver.Factory, driver: SQLiteMCDriver) -> Unit
): TestResult = runTest {
): TestResult = runTest(timeout = timeout) {
val dbName = Random.Default.nextBytes(32).encodeToString(Base16) + ".db"

deleteDatabaseFiles(dbName)
Expand Down
5 changes: 2 additions & 3 deletions library/driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ kmpConfiguration {
}

fun CompileToBitcodeExtension.createSqlite3mc() {
val xcode = try {
val xcode = if (HostManager.hostIsMac) {
Xcode.findCurrent()
} catch (t: Throwable) {
if (HostManager.hostIsMac) throw t
} else {
null
}

Expand Down

0 comments on commit 25f4fe4

Please sign in to comment.