-
Notifications
You must be signed in to change notification settings - Fork 946
Clean up recovery spec tests #3085
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
Conversation
Binary Size ReportAffected SDKsNo changes between base commit (d656e03) and head commit (6433a50). Test Logs
|
'Synchronize last document change read time': true, | ||
'Lookup mutation documents': true | ||
}) | ||
.failDatabaseTransactions('Lookup mutation documents') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a different test than what was here before. Previously the write of the mutation to IndexedDB would fail (as would the lookup) but now this is failing just the lookup and allowing the write to succeed?
Alternatively, if this is working as intended, better names would help make it clearer just which transaction is failing. For example, if this were named multitab.secondary.mutationLookup
it would be much, much clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a dedicated test that test if "Locally write mutations" fails ("Recovers when write cannot be persisted"). The fact that "Locally write mutations" is part of this list seems like an oversight to me - the mutation gets written right before and not after we start injecting failures.
There are certainly improvements to the transaction names that we should make before we port to Android/iOS, but I would like to point out that 'Lookup mutation documents' is also used by the primary tab to load a mutation that has been written by a secondary tab.
'Lookup mutation documents': true, | ||
'Get new document changes': true | ||
}) | ||
.failDatabaseTransactions('Get new document changes') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same concern here: previously this failed to allocate a target at all, which should have caused the listen to fail. Now this is only failing much later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar response: The target is already allocated and this seems like a copy/paste issue. Failed target allocations are tested in 'Fails targets that cannot be allocated'.
I am not 100% convinced we need multi-tab specific tests for these initial failures, since these failures happen before we kick off any multi-tab specific failures. If we add a test, it would be a sanity check to ensure that we don't write a Local Storage notification if we failed to persist the target/write.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I see it now. Thanks for talking it through with me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
'Lookup mutation documents': true, | ||
'Get new document changes': true | ||
}) | ||
.failDatabaseTransactions('Get new document changes') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I see it now. Thanks for talking it through with me.
Almost all recovery spec tests only fail a single Transaction type. This PR cleans up the spec tests to make the calling code a lot prettier.