From 7098f0f1acaeadb522da5b0a1bff3b0ec9366cde Mon Sep 17 00:00:00 2001 From: Christian Melchior Date: Fri, 8 Sep 2023 10:46:28 +0200 Subject: [PATCH] Update BAAS test server version (#1506) --- dependencies.list | 6 +++--- .../kotlin/io/realm/kotlin/test/util/Utils.kt | 4 ++-- .../common/FlexibleSyncIntegrationTests.kt | 4 ++-- .../kotlin/test/mongodb/common/FunctionsTests.kt | 2 +- .../test/mongodb/common/SubscriptionSetTests.kt | 15 ++++++++++++--- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/dependencies.list b/dependencies.list index eb618c86ba..19abf07b21 100644 --- a/dependencies.list +++ b/dependencies.list @@ -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 diff --git a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/Utils.kt b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/Utils.kt index 3068aea342..5e72a273dd 100644 --- a/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/Utils.kt +++ b/packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/Utils.kt @@ -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 { @@ -92,7 +92,7 @@ fun Instant.toRealmInstant(): RealmInstant { } // Variant of `Channel.receiveOrFail()` that will will throw if a timeout is hit. -suspend fun Channel.receiveOrFail(timeout: Duration = 30.seconds): T { +suspend fun Channel.receiveOrFail(timeout: Duration = 1.minutes): T { return withTimeout(timeout) { receive() } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FlexibleSyncIntegrationTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FlexibleSyncIntegrationTests.kt index 7ad9ff466a..f6597162ec 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FlexibleSyncIntegrationTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FlexibleSyncIntegrationTests.kt @@ -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" }) @@ -156,7 +156,7 @@ class FlexibleSyncIntegrationTests { val query = realm.query("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().count().find()) } } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt index 1fd31781cf..354bc859ac 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/FunctionsTests.kt @@ -1015,7 +1015,7 @@ class FunctionsTests { runBlocking { anonUser.logOut() } - assertFailsWithMessage("[Service][Unknown(4351)] expected Authorization header with JWT") { + assertFailsWithMessage("[Service][Unknown(4351)] unauthorized") { runBlocking { functions.call(FIRST_ARG_FUNCTION.name, 1, 2, 3) } diff --git a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SubscriptionSetTests.kt b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SubscriptionSetTests.kt index 68976a40bf..b18352c597 100644 --- a/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SubscriptionSetTests.kt +++ b/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/SubscriptionSetTests.kt @@ -192,7 +192,10 @@ class SubscriptionSetTests { assertFailsWith { 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() } @@ -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 @@ -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