matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Fix failing room invite tests #1322

Closed kegsay closed 2 years ago

kegsay commented 4 years ago

Sytests:

    × Invited user can reject invite over federation several times
    × Test that we can be reinvited to a room we created
qustavo commented 3 years ago

× Invited user can reject invite over federation several times seems to be passing:

Running tests/30rooms/06invite.pl shows:

[...]
Test 5 Invited user can reject invite over federation several times... OK
[...]
ZofiaZementa commented 2 years ago

Hi! I'd like to work on this issue I'm new to dendrite, but so far i think i have a good idea where to start

ZofiaZementa commented 2 years ago

Ok, so I'm in no way an expert in perl, but it seems to me that the test in question, tests/90jira/SYN-442.pl, is requesting /_matrix/client/r0/events to check whether user b even got the invite from user a. The logs of the test back this up. Since, as far as I understand, dendrite doesn't implement this, the test fails here, before user a even leaves the room it created. The test never gets to the point to actually check whether user a can rejoin the room after leaving it:

[...]
# Starting server-1
[...]
# Started server-0
  ok 1 User A created a room (Test that we can be reinvited to a room we created)
  ok 2 User A set the join rules to 'invite' (Test that we can be reinvited to a room we created)
  ok 3 User A invited user B (Test that we can be reinvited to a room we created)
  1..3
not ok 1 (expected fail) Test that we can be reinvited to a room we created # TODO expected fail
# Started: 2021-10-26 13:50:48.413
# Ended: 2021-10-26 13:51:05.865
# Timed out waiting for test at ./run-tests.pl line 787.
# 2.548896: Registered new user @anon-20211026_135048-2:localhost:8802
# 7.448710: Registered new user @anon-20211026_135048-1:localhost:8800
# 7.542868: Invited user @anon-20211026_135048-2:localhost:8802 to !KPktNjBTPeFsJEJw:localhost:8800
# {}
# 7.545021: GET_new_events_for @anon-20211026_135048-2:localhost:8802:
# { chunk => [], end => "", start => "" }
# 7.546703: GET_new_events_for @anon-20211026_135048-2:localhost:8802:
# { chunk => [], end => "", start => "" }
[...]
kegsay commented 2 years ago

Thanks for looking into this, I'll see if I can fix up these tests.