diff options
author | devonh <devon.dmytro@gmail.com> | 2022-10-20 15:37:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-20 15:37:35 +0000 |
commit | b58c9bb094f3a069a4f40bbd6cc4a0ac205afcb6 (patch) | |
tree | 9f12e69fe5ed56e1be3678260854511deabbd9b7 /federationapi | |
parent | 539c61b3db4a76729e90a52823be89c32cbeb5ec (diff) |
Fix flakey queue test (#2818)
Ensure both events are added to the database, even if the destination is
already blacklisted.
Diffstat (limited to 'federationapi')
-rw-r--r-- | federationapi/queue/queue_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/federationapi/queue/queue_test.go b/federationapi/queue/queue_test.go index 6da9e6b3..40419b91 100644 --- a/federationapi/queue/queue_test.go +++ b/federationapi/queue/queue_test.go @@ -1004,9 +1004,12 @@ func TestQueueInteractsWithRealDatabasePDUAndEDU(t *testing.T) { err := queues.SendEvent(ev, "localhost", []gomatrixserverlib.ServerName{destination}) assert.NoError(t, err) + // NOTE : The server can be blacklisted before this, so manually inject the event + // into the database. edu := mustCreateEDU(t) - errEDU := queues.SendEDU(edu, "localhost", []gomatrixserverlib.ServerName{destination}) - assert.NoError(t, errEDU) + ephemeralJSON, _ := json.Marshal(edu) + nid, _ := db.StoreJSON(pc.Context(), string(ephemeralJSON)) + db.AssociateEDUWithDestination(pc.Context(), destination, nid, edu.Type, nil) checkBlacklisted := func(log poll.LogT) poll.Result { if fc.txCount.Load() == failuresUntilBlacklist { |