Skip to content

Commit 68c7643

Browse files
Unskip dendrite skipif on a members presence test (#516)
* Make local members presence test more reliable and able to be ran in isolation * add explicit presence-setting * fix dendrite test failure * fix imports * apply review feedback * add more parentheses, change skipif note, and remove additional skipif * address review feedback --------- Co-authored-by: kegsay <[email protected]>
1 parent ae1f8f2 commit 68c7643

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

tests/csapi/rooms_members_local_test.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import (
99
)
1010

1111
func TestMembersLocal(t *testing.T) {
12-
deployment := Deploy(t, b.BlueprintOneToOneRoom)
12+
deployment := Deploy(t, b.BlueprintAlice)
1313
defer deployment.Destroy(t)
1414

1515
alice := deployment.Client(t, "hs1", "@alice:hs1")
16-
bob := deployment.Client(t, "hs1", "@bob:hs1")
16+
// Here we don't use the BlueprintOneToOneRoom because else Bob would be able to see Alice's presence changes through
17+
// that pre-existing one-on-one DM room. So we exclude that here.
18+
bob := deployment.RegisterUser(t, "hs1", "bob", "bobspassword", false)
1719
roomID := alice.CreateRoom(t, map[string]interface{}{"preset": "public_chat"})
1820

1921
bob.MustDoFunc(
@@ -23,7 +25,7 @@ func TestMembersLocal(t *testing.T) {
2325
}),
2426
)
2527

26-
_, incrementalSyncToken := alice.MustSync(t, client.SyncReq{})
28+
_, incrementalSyncTokenBeforeBobJoinsRoom := alice.MustSync(t, client.SyncReq{TimeoutMillis: "0"})
2729
bob.JoinRoom(t, roomID, []string{})
2830

2931
t.Run("Parallel", func(t *testing.T) {
@@ -38,15 +40,17 @@ func TestMembersLocal(t *testing.T) {
3840
t.Run("Existing members see new members' join events", func(t *testing.T) {
3941
t.Parallel()
4042
// SyncJoinedTo already checks everything we need to know
41-
alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(bob.UserID, roomID))
43+
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncTokenBeforeBobJoinsRoom}, client.SyncJoinedTo(bob.UserID, roomID))
4244
})
4345

4446
// sytest: Existing members see new members' presence
4547
// Split into initial and incremental sync cases in Complement.
46-
t.Run("Existing members see new members' presence in initial sync", func(t *testing.T) {
47-
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/dendrite/issues/2803
48+
t.Run("Existing members see new members' presence (in initial sync)", func(t *testing.T) {
49+
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/matrix-spec/issues/1374
4850
t.Parallel()
51+
// First we sync to make sure bob to have joined the room...
4952
alice.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(bob.UserID, roomID))
53+
// ...and then we do another initial sync - this time waiting for bob's presence - to confirm we can get that.
5054
alice.MustSyncUntil(t, client.SyncReq{},
5155
client.SyncJoinedTo(bob.UserID, roomID),
5256
client.SyncPresenceHas(bob.UserID, nil),
@@ -55,10 +59,9 @@ func TestMembersLocal(t *testing.T) {
5559

5660
// sytest: Existing members see new members' presence
5761
// Split into initial and incremental sync cases in Complement.
58-
t.Run("Existing members see new members' presence in incremental sync", func(t *testing.T) {
59-
runtime.SkipIf(t, runtime.Dendrite) // FIXME: https://github.com/matrix-org/dendrite/issues/2803
62+
t.Run("Existing members see new members' presence (in incremental sync)", func(t *testing.T) {
6063
t.Parallel()
61-
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncToken},
64+
alice.MustSyncUntil(t, client.SyncReq{Since: incrementalSyncTokenBeforeBobJoinsRoom},
6265
client.SyncJoinedTo(bob.UserID, roomID),
6366
client.SyncPresenceHas(bob.UserID, nil),
6467
)

0 commit comments

Comments
 (0)