Skip to content

Commit

Permalink
Fix a race condition in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoyne committed Apr 22, 2024
1 parent a5bb5be commit d9e8b0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/test_sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6609,8 +6609,6 @@ TEST(Sync_BundledRealmFile)
fixtures::ClientServerFixture fixture{dir, test_context};
fixture.start();

Session session = fixture.make_bound_session(db);

write_transaction(db, [](WriteTransaction& tr) {
auto foos = tr.get_group().add_table_with_primary_key("class_Foo", type_Int, "id");
foos->create_object_with_primary_key(123);
Expand All @@ -6619,6 +6617,7 @@ TEST(Sync_BundledRealmFile)
// We cannot write out file if changes are not synced to server
CHECK_THROW_ANY(db->write_copy(path.c_str(), nullptr));

Session session = fixture.make_bound_session(db);
session.wait_for_upload_complete_or_client_stopped();
session.wait_for_download_complete_or_client_stopped();

Expand Down

0 comments on commit d9e8b0a

Please sign in to comment.