Skip to content

Commit

Permalink
Merge pull request #6499 from realm/km/fix-test-assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
tkaye407 authored Apr 14, 2023
2 parents ef860e7 + 5e71187 commit 48e47ab
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 44 deletions.
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PACKAGE_NAME=realm-core
VERSION=13.9.0
OPENSSL_VERSION=3.0.8
WIN32_ZLIB_VERSION=1.2.13
MDBREALM_TEST_SERVER_TAG=2023-03-16
MDBREALM_TEST_SERVER_TAG=2023-04-13
2 changes: 1 addition & 1 deletion evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ tasks:
export DEVELOPER_DIR="${xcode_developer_dir}"
fi
./evergreen/install_baas.sh -w ./baas-work-dir -b 5d5a4f470da7f84132ff97c8b56368e98ad17489 2>&1 | tee install_baas_output.log
./evergreen/install_baas.sh -w ./baas-work-dir -b cfda5c63e6910091853d3fb1085dcf45396279bb 2>&1 | tee install_baas_output.log
fi
- command: shell.exec
Expand Down
2 changes: 1 addition & 1 deletion how-to-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ cmake --build build.sync.ninja --target realm-object-store-tests
```
### Developing inside a container

The `.devcontainer` folders contains configuration for the [Visual Stuio Code Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension, which allows you to develop inside the same Docker container that CI runs in, which is especially useful because it also sets up the MongoDB Realm Test Server container. Make sure you have the `Remote - Containers` extension installed (it's part of the recommended extensions list for this repository) and run the `Remote-Containers: Reopen in Container` (or `Rebuild and Reopen in Container`) command. VSCode will build the image described in `Dockerfile`, spin up a container group using Docker Compose, and reopen the workspace from inside the container.
The `.devcontainer` folders contains configuration for the [Visual Studio Code Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension, which allows you to develop inside the same Docker container that CI runs in, which is especially useful because it also sets up the MongoDB Realm Test Server container. Make sure you have the `Remote - Containers` extension installed (it's part of the recommended extensions list for this repository) and run the `Remote-Containers: Reopen in Container` (or `Rebuild and Reopen in Container`) command. VSCode will build the image described in `Dockerfile`, spin up a container group using Docker Compose, and reopen the workspace from inside the container.

#### `ssh-agent` forwarding

Expand Down
42 changes: 1 addition & 41 deletions test/object-store/sync/flx_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ TEST_CASE("flx: bootstrap batching prevents orphan documents", "[sync][flx][app]
REQUIRE(pending_batch.query_version == 1);
REQUIRE(static_cast<bool>(pending_batch.progress));
REQUIRE(pending_batch.remaining_changesets == 0);
REQUIRE(pending_batch.changesets.size() == 3);
REQUIRE(pending_batch.changesets.size() == 6);

check_interrupted_state(realm);
}
Expand Down Expand Up @@ -2946,46 +2946,6 @@ TEST_CASE("flx: bootstrap changesets are applied continuously", "[sync][flx][app
}


TEST_CASE("flx: really big bootstraps", "[sync][flx][app]") {
FLXSyncTestHarness harness("harness");

std::vector<ObjectId> expected_obj_ids;
harness.load_initial_data([&](SharedRealm realm) {
realm->cancel_transaction();
for (size_t n = 0; n < 10; ++n) {
realm->begin_transaction();
for (size_t i = 0; i < 100; ++i) {
expected_obj_ids.push_back(ObjectId::gen());
auto& obj_id = expected_obj_ids.back();
CppContext c(realm);
Object::create(c, realm, "TopLevel",
std::any(AnyDict{{"_id", obj_id},
{"queryable_str_field", "foo"s},
{"queryable_int_field", static_cast<int64_t>(5)},
{"non_queryable_field", random_string(1024 * 128)}}));
}
realm->commit_transaction();
}
realm->begin_transaction();
});

SyncTestFile target(harness.app()->current_user(), harness.schema(), SyncConfig::FLXSyncEnabled{});
auto error_pf = util::make_promise_future<SyncError>();
target.sync_config->error_handler = [promise = util::CopyablePromiseHolder(std::move(error_pf.promise))](
std::shared_ptr<SyncSession>, SyncError err) mutable {
promise.get_promise().emplace_value(std::move(err));
};
auto realm = Realm::get_shared_realm(target);
auto mut_subs = realm->get_latest_subscription_set().make_mutable_copy();
mut_subs.insert_or_assign(Query(realm->read_group().get_table("class_TopLevel")));
auto subs = mut_subs.commit();

// TODO when BAAS-19105 is fixed we should be able to just wait for bootstrapping to be complete. For now though,
// check that we get the error code we expect.
auto err = error_pf.future.get();
REQUIRE(err.get_system_error() == sync::ClientError::bad_changeset_size);
}

} // namespace realm::app

#endif // REALM_ENABLE_AUTH_TESTS

0 comments on commit 48e47ab

Please sign in to comment.