Update the soft-fail tests to work with recent room versions#1149
Merged
Conversation
Rather than manually building the (event_id, event_hash) prev_event structures, use `$room->make_event_refs` to do this, which means it will also work on later room verions. This means we need access to the events themselves rather than just the IDs, so needs a bit of tweaking for that.
When we create an event with prev_events which put that event on a historical branch, we also need to use the auth_events corresponding to that point on the DAG. Otherwise, the server can end up pulling in the state from the main branch anyway, and rejecting, rather than soft-failing, the relevant events. (Exactly whether the state gets pulled in from the auth_events depends on the state resolution algorithm in use, hence on the room version).
clokep
approved these changes
Oct 6, 2021
clokep
left a comment
Member
There was a problem hiding this comment.
Pretty sure all this makes sense!
Is this the sort of test that would benefit from running over multiple room versions?
Member
Author
No more so than much of the rest of Sytest, I'd say. We have the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have some tests in
tests/50federation/52soft-fail.plwhich test soft-failing, but which have never been updated to work with room versions other than v1.For the most part, this is just a matter of updating them to use utility functions instead of making assumptions about the shapes of the events, but it turns out that there is another wrinkle, which is that they were making some assumptions about the state-resolution algorithm which are not true in subsequent room versions. More info in the commit comments.
Reviewable commit-by-commit.