forked from matrix-org/complement
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reproduction of the situation for a Synapse consistency issue
Reproduction test for element-hq/synapse#18075
- Loading branch information
1 parent
08ab613
commit 3e03473
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package csapi_tests | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matrix-org/complement" | ||
"github.com/matrix-org/complement/client" | ||
"github.com/matrix-org/complement/helpers" | ||
) | ||
|
||
func TestSynapseConsistency(t *testing.T) { | ||
numHomeservers := 2 | ||
deployment := complement.Deploy(t, numHomeservers) | ||
defer deployment.Destroy(t) | ||
|
||
alice := deployment.Register(t, "hs1", helpers.RegistrationOpts{LocalpartSuffix: "alice"}) | ||
|
||
charlie1 := deployment.Register(t, "hs2", helpers.RegistrationOpts{LocalpartSuffix: "charlie1"}) | ||
charlie2 := deployment.Register(t, "hs2", helpers.RegistrationOpts{LocalpartSuffix: "charlie2"}) | ||
|
||
t.Run("test1", func(t *testing.T) { | ||
// Create a room on hs1 | ||
roomID := alice.MustCreateRoom(t, map[string]interface{}{ | ||
"preset": "private_chat", | ||
}) | ||
|
||
// Invite multiple users from hs2 | ||
alice.MustInviteRoom(t, roomID, charlie1.UserID) | ||
charlie1.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(charlie1.UserID, roomID)) | ||
charlie1.MustJoinRoom(t, roomID, []string{"hs1"}) | ||
|
||
alice.MustInviteRoom(t, roomID, charlie2.UserID) | ||
charlie2.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(charlie2.UserID, roomID)) | ||
charlie2.MustJoinRoom(t, roomID, []string{"hs1"}) | ||
}) | ||
} |