Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to core 13.25.0 #8440

Closed
wants to merge 11 commits into from
Closed

Upgrade to core 13.25.0 #8440

wants to merge 11 commits into from

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Dec 18, 2023

No description provided.

ObjectServer tests were being built and run twice. To avoid this problem
without needing the guards on every single test action, ci-pr is now only
invoked if the CI scheme is being built.

xcode_cloud_helper.rb now supports automatically generating a token before
running the task rather than generating a token being a separate command.
I ended up fiddling with the script a lot.

REALM_DISABLE_ANALYTICS is now set in the scheme so that it applies to all test
runs, including those on Xcode Cloud.

Job details are now mostly consolidated in pr-ci-matrix.rb rather than trying
to determine things like the test destination from the name.
…hange

Core has allowed this for a while, but we had our own validation which made it not work.
The RLMSyncSubscriptionSet was retained until the task was deallocated even
after the task completed, which is not strictly incorrect but made a test
unreliable.
This compiles because the value can be implicitly converted to an optional, but
it isn't actually checking anything. Even if the non-optional has an invalid
nil value, it ends up as `.some(invalid)` and will pass the test.
We'll never get a success after an error, so not fulfilling the expectation
just pointless waits for a timeout.
This unfortunately turned into a giant unreviewable mess, but I don't really
know how to split it up. An overview of the changes:

Each XCTestCase subclass now creates a server-side App which is used for most
of the tests in that test case. Apps are now never shared between test cases,
and do not share Mongo collections with other apps. Together this means that
state from one test case should never bleed over to other test cases.

This required rearranging many of the tests, as we had test cases with both PBS
and FLX tests. While doing this I also discovered several tests which were just
plain in the wrong test case due to files having multiple multi-thousand-line
test cases and people thought they were adding tests to the one defined at the
top. I split these files into multiple files, which I think makes things much
more managable but unfortunately results in the diff being unhelpful.

Each test case now explicitly defines which set of classes it uses, and only
Rules for those classes is created in the server app. This cuts the time
required to create apps roughly in half and helps offset the fact that we're
now creating more apps. It also gets rid of the weird things like the hardcoded
list of flx-compatible types in RealmServer.

Creating an app now waits for the initial sync to complete. With PBS this is
required to avoid some very strange bugs. With FLX it mostly ensures that if
this times out for some reason we get a test failure there, rather than later
in some very confusing place in the middle of a test.

Client reset tests now use the API endpoint for FLX in addition to PBS. This
makes them dramatically faster (several seconds instead of 30+).

FLX tests now consistently follow the pattern of using one of the object fields
as a partition key to query on rather than querying for all objects of a type.
Some tests already did this, while others tried to clear the data first (which
did not always work if the server was in the middle of processing old
requests), and some just plain broke if tests were run in the wrong order.

In the very early days of sync, opening the same Realm URL twice required two
different processes, so all our sync tests spawned child processes. That hasn't
been true for a very long time, but the tests stuck around and some more were
written in that style due to mimicking the existing tests. I've ported almost
all of them over to operating in a single process, which makes them both
simpler and much faster (5s to .5s in many cases).

The tests are now run with developer mode off. This was initially required due
to the change where opening with a class subset is now considered a breaking
change in developer mode, but now that test cases explicitly specify their
types that isn't a problem any more. However, it does let us once again test
subscriptions failing due to an unqueryable field, and that test revealed that
we were using the wrong error domain for that error.

I added some new helper functions for the things I discovered I was going to
have to change in literally hundreds of places. Creating a temporary user is
now just `self.createUser()` rather than separate steps of creating credentials
and logging in. `self.name` is now used as the tag value for partitions and
user names and such rather than `#function` or `NSStringFromSelector(_cmd)`,
which makes it so that it doesn't have to be explicitly passed into helper
functions. There were a number of places where this previously was done
incorrectly and `#function` was used inside helper functions, which didn't
achieve the desired effect.
@tgoyne tgoyne self-assigned this Dec 18, 2023
@tgoyne tgoyne closed this Dec 19, 2023
@tgoyne tgoyne deleted the tg/update-core branch December 19, 2023 16:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant