Skip to content

Commit

Permalink
Update BAAS test server version (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmelchior authored Sep 8, 2023
1 parent 11f421a commit 7098f0f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
6 changes: 3 additions & 3 deletions dependencies.list
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Version of MongoDB Realm used by integration tests
# See https://github.com/realm/ci/packages/147854 for available versions
MONGODB_REALM_SERVER=2023-05-15
MONGODB_REALM_SERVER=2023-09-07

# `BAAS` and `BAAS-UI` projects commit hashes matching MONGODB_REALM_SERVER image version
# note that the MONGODB_REALM_SERVER image is a nightly build, find the matching commits
# for that date within the following repositories:
# https://github.com/10gen/baas/
# https://github.com/10gen/baas-ui/
REALM_BAAS_GIT_HASH=92fc646871b507c73e48cc05ebec54fc9a134ae7
REALM_BAAS_UI_GIT_HASH=67ad3606ec1137640ea84dcfe7a1a1b29aa7508f
REALM_BAAS_GIT_HASH=fc070ea7e874f58eb5b4f7a9d344fa7cdd755817
REALM_BAAS_UI_GIT_HASH=ca722f5bb7a7485404a68874991ba8e50787ea9a
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.withTimeout
import kotlinx.datetime.Instant
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import kotlin.time.Duration.Companion.minutes

// Platform independent helper methods
object Utils {
Expand Down Expand Up @@ -92,7 +92,7 @@ fun Instant.toRealmInstant(): RealmInstant {
}

// Variant of `Channel.receiveOrFail()` that will will throw if a timeout is hit.
suspend fun <T : Any?> Channel<T>.receiveOrFail(timeout: Duration = 30.seconds): T {
suspend fun <T : Any?> Channel<T>.receiveOrFail(timeout: Duration = 1.minutes): T {
return withTimeout(timeout) {
receive()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class FlexibleSyncIntegrationTests {
.query("(name = 'red' OR name = 'blue')")
add(query, "sub")
}
assertTrue(realm.subscriptions.waitForSynchronization(60.seconds))
assertTrue(realm.subscriptions.waitForSynchronization(120.seconds))
realm.write {
copyToRealm(FlexParentObject(randomSection).apply { name = "red" })
copyToRealm(FlexParentObject(randomSection).apply { name = "blue" })
Expand All @@ -156,7 +156,7 @@ class FlexibleSyncIntegrationTests {
val query = realm.query<FlexParentObject>("section = $0 AND name = 'red'", randomSection)
add(query, "sub", updateExisting = true)
}
assertTrue(realm.subscriptions.waitForSynchronization(60.seconds))
assertTrue(realm.subscriptions.waitForSynchronization(120.seconds))
assertEquals(1, realm.query<FlexParentObject>().count().find())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ class FunctionsTests {
runBlocking {
anonUser.logOut()
}
assertFailsWithMessage<ServiceException>("[Service][Unknown(4351)] expected Authorization header with JWT") {
assertFailsWithMessage<ServiceException>("[Service][Unknown(4351)] unauthorized") {
runBlocking {
functions.call(FIRST_ARG_FUNCTION.name, 1, 2, 3)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ class SubscriptionSetTests {
assertFailsWith<BadFlexibleSyncQueryException> {
subscriptions.waitForSynchronization()
}
assertTrue(subscriptions.errorMessage!!.contains("Client provided query with bad syntax"))
assertTrue(
subscriptions.errorMessage!!.contains("Invalid query: invalid RQL for table \"FlexParentObject\": syntax error: unexpected Limit, expecting Or or RightParenthesis"),
subscriptions.errorMessage
)
subscriptions.update {
removeAll()
}
Expand Down Expand Up @@ -258,7 +261,10 @@ class SubscriptionSetTests {
updatedSubs.waitForSynchronization()
}
assertEquals(SubscriptionSetState.ERROR, updatedSubs.state)
assertTrue(updatedSubs.errorMessage!!.contains("Client provided query with bad syntax"))
assertTrue(
updatedSubs.errorMessage!!.contains("Invalid query: invalid RQL for table \"FlexParentObject\": syntax error: unexpected Limit, expecting Or or RightParenthesis"),
updatedSubs.errorMessage
)
}

// Test case for https://github.com/realm/realm-core/issues/5504
Expand All @@ -272,7 +278,10 @@ class SubscriptionSetTests {
}
assertEquals(SubscriptionSetState.ERROR, updatedSubs.state)
assertEquals("TRUEPREDICATE and TRUEPREDICATE LIMIT(1)", updatedSubs.first().queryDescription)
assertTrue(updatedSubs.errorMessage!!.contains("Client provided query with bad syntax"))
assertTrue(
updatedSubs.errorMessage!!.contains("Invalid query: invalid RQL for table \"FlexParentObject\": syntax error: unexpected Limit, expecting Or or RightParenthesis"),
updatedSubs.errorMessage
)
}

@Test
Expand Down

0 comments on commit 7098f0f

Please sign in to comment.