From 392fe89fac1538913379b465d5cb5d49d792fc4c Mon Sep 17 00:00:00 2001 From: Daniel Tabacaru Date: Sat, 1 Jun 2024 21:16:41 +0200 Subject: [PATCH] Fix race in schema migration tests --- test/object-store/sync/flx_schema_migration.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/object-store/sync/flx_schema_migration.cpp b/test/object-store/sync/flx_schema_migration.cpp index 4c6c3ef4849..7c2303c7df9 100644 --- a/test/object-store/sync/flx_schema_migration.cpp +++ b/test/object-store/sync/flx_schema_migration.cpp @@ -498,7 +498,7 @@ TEST_CASE("Upgrade schema version (with recovery) then downgrade", "[sync][flx][ wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); // Subscription to recover when upgrading the schema. auto subs = realm->get_latest_subscription_set().make_mutable_copy(); @@ -771,7 +771,7 @@ TEST_CASE("Client reset during schema migration", "[sync][flx][flx schema migrat wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); realm->begin_transaction(); CppContext c(realm); @@ -862,7 +862,7 @@ TEST_CASE("Migrate to new schema version after migration to intermediate version wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); realm->begin_transaction(); CppContext c(realm); @@ -1011,7 +1011,7 @@ TEST_CASE("Client reset and schema migration", "[sync][flx][flx schema migration wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); realm->begin_transaction(); CppContext c(realm); @@ -1088,7 +1088,7 @@ TEST_CASE("Multiple async open tasks trigger a schema migration", "[sync][flx][f wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); // Subscription to recover when upgrading the schema. auto subs = realm->get_latest_subscription_set().make_mutable_copy(); @@ -1181,7 +1181,7 @@ TEST_CASE("Upgrade schema version with no subscription initializer", "[sync][flx wait_for_upload(*realm); check_realm_schema(config.path, schema_v0, 0); - realm->sync_session()->pause(); + realm->sync_session()->shutdown_and_wait(); // Object to recover when upgrading the schema. realm->begin_transaction();