aboutsummaryrefslogtreecommitdiff
path: root/syncapi/syncapi_test.go
diff options
context:
space:
mode:
authorTill Faelligen <2353100+S7evinK@users.noreply.github.com>2022-08-18 08:56:57 +0200
committerTill Faelligen <2353100+S7evinK@users.noreply.github.com>2022-08-18 08:56:57 +0200
commit8d9c8f11c5c5673d48b8e5308e1f565927bdd341 (patch)
treebd8f268bee5bfec2e20c5afc98fc67cf2fcb1c3d /syncapi/syncapi_test.go
parentad4ac2c016d2916c51695fd11d3a7b52e38d0ca2 (diff)
Add a delay after sending events to the roomserver
Diffstat (limited to 'syncapi/syncapi_test.go')
-rw-r--r--syncapi/syncapi_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/syncapi/syncapi_test.go b/syncapi/syncapi_test.go
index dc073a16..089bdafa 100644
--- a/syncapi/syncapi_test.go
+++ b/syncapi/syncapi_test.go
@@ -10,6 +10,10 @@ import (
"testing"
"time"
+ "github.com/matrix-org/gomatrixserverlib"
+ "github.com/nats-io/nats.go"
+ "github.com/tidwall/gjson"
+
"github.com/matrix-org/dendrite/clientapi/producers"
keyapi "github.com/matrix-org/dendrite/keyserver/api"
"github.com/matrix-org/dendrite/roomserver"
@@ -21,9 +25,6 @@ import (
"github.com/matrix-org/dendrite/test"
"github.com/matrix-org/dendrite/test/testrig"
userapi "github.com/matrix-org/dendrite/userapi/api"
- "github.com/matrix-org/gomatrixserverlib"
- "github.com/nats-io/nats.go"
- "github.com/tidwall/gjson"
)
type syncRoomserverAPI struct {
@@ -422,6 +423,7 @@ func testHistoryVisibility(t *testing.T, dbType test.DBType) {
if err := api.SendEvents(ctx, rsAPI, api.KindNew, eventsToSend, "test", "test", nil, false); err != nil {
t.Fatalf("failed to send events: %v", err)
}
+ time.Sleep(100 * time.Millisecond) // TODO: find a better way
// There is only one event, we expect only to be able to see this, if the room is world_readable
w := httptest.NewRecorder()
@@ -454,6 +456,7 @@ func testHistoryVisibility(t *testing.T, dbType test.DBType) {
if err := api.SendEvents(ctx, rsAPI, api.KindNew, eventsToSend, "test", "test", nil, false); err != nil {
t.Fatalf("failed to send events: %v", err)
}
+ time.Sleep(100 * time.Millisecond) // TODO: find a better way
// Verify the messages after/before invite are visible or not
w = httptest.NewRecorder()