Skip to content

Commit 083a711

Browse files
authored
Fix partial state join tests for incorrectly accepted/rejected state (#452)
These broke during the merge of #441.
1 parent 708348a commit 083a711

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/federation_room_join_partial_state_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ func TestPartialStateJoin(t *testing.T) {
828828
deployment := Deploy(t, b.BlueprintAlice)
829829
defer deployment.Destroy(t)
830830
alice := deployment.Client(t, "hs1", "@alice:hs1")
831+
syncToken := getSyncToken(t, alice)
831832
server := createTestServer(t, deployment)
832833
cancel := server.Listen()
833834
defer cancel()
@@ -898,12 +899,12 @@ func TestPartialStateJoin(t *testing.T) {
898899
server.MustSendTransaction(t, deployment, "hs1", []json.RawMessage{badStateEvent.JSON()}, nil)
899900

900901
// the bad state event should be visible at this point
901-
awaitEventArrival(t, time.Second, alice, serverRoom.RoomID, badStateEvent.EventID())
902+
syncToken = awaitEventViaSync(t, alice, serverRoom.RoomID, badStateEvent.EventID(), syncToken)
902903

903904
// now finish up the partial join.
904905
event := psjResult.CreateMessageEvent(t, "charlie", nil)
905906
t.Logf("charlie created regular timeline event %s", event.EventID())
906-
testReceiveEventDuringPartialStateJoin(t, deployment, alice, psjResult, event)
907+
testReceiveEventDuringPartialStateJoin(t, deployment, alice, psjResult, event, syncToken)
907908

908909
// the bad state event should now *not* be visible
909910
must.MatchResponse(t,
@@ -921,6 +922,7 @@ func TestPartialStateJoin(t *testing.T) {
921922
deployment := Deploy(t, b.BlueprintAlice)
922923
defer deployment.Destroy(t)
923924
alice := deployment.Client(t, "hs1", "@alice:hs1")
925+
syncToken := getSyncToken(t, alice)
924926
server := createTestServer(t, deployment)
925927
cancel := server.Listen()
926928
defer cancel()
@@ -1018,10 +1020,10 @@ func TestPartialStateJoin(t *testing.T) {
10181020
[]json.RawMessage{badKickEvent.JSON(), rejectedStateEvent.JSON(), sentinelEvent.JSON()}, nil)
10191021

10201022
// the bad kick event should be visible at this point
1021-
awaitEventArrival(t, time.Second, alice, serverRoom.RoomID, badKickEvent.EventID())
1023+
awaitEventViaSync(t, alice, serverRoom.RoomID, badKickEvent.EventID(), syncToken)
10221024

10231025
// ... but the rejected state event should not.
1024-
awaitEventArrival(t, time.Second, alice, serverRoom.RoomID, sentinelEvent.EventID())
1026+
syncToken = awaitEventViaSync(t, alice, serverRoom.RoomID, sentinelEvent.EventID(), syncToken)
10251027
must.MatchResponse(t,
10261028
alice.DoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", serverRoom.RoomID, "event", rejectedStateEvent.EventID()}),
10271029
match.HTTPResponse{
@@ -1035,7 +1037,7 @@ func TestPartialStateJoin(t *testing.T) {
10351037
// now finish up the partial join.
10361038
event := psjResult.CreateMessageEvent(t, "charlie", nil)
10371039
t.Logf("charlie created regular timeline event %s", event.EventID())
1038-
testReceiveEventDuringPartialStateJoin(t, deployment, alice, psjResult, event)
1040+
testReceiveEventDuringPartialStateJoin(t, deployment, alice, psjResult, event, syncToken)
10391041

10401042
// the bad kick event should now *not* be visible
10411043
must.MatchResponse(t,

0 commit comments

Comments
 (0)