mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-29 17:51:56 -06:00
Fix flakey queue test (#2818)
Ensure both events are added to the database, even if the destination is already blacklisted.
This commit is contained in:
parent
539c61b3db
commit
b58c9bb094
|
@ -1004,9 +1004,12 @@ func TestQueueInteractsWithRealDatabasePDUAndEDU(t *testing.T) {
|
||||||
err := queues.SendEvent(ev, "localhost", []gomatrixserverlib.ServerName{destination})
|
err := queues.SendEvent(ev, "localhost", []gomatrixserverlib.ServerName{destination})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
// NOTE : The server can be blacklisted before this, so manually inject the event
|
||||||
|
// into the database.
|
||||||
edu := mustCreateEDU(t)
|
edu := mustCreateEDU(t)
|
||||||
errEDU := queues.SendEDU(edu, "localhost", []gomatrixserverlib.ServerName{destination})
|
ephemeralJSON, _ := json.Marshal(edu)
|
||||||
assert.NoError(t, errEDU)
|
nid, _ := db.StoreJSON(pc.Context(), string(ephemeralJSON))
|
||||||
|
db.AssociateEDUWithDestination(pc.Context(), destination, nid, edu.Type, nil)
|
||||||
|
|
||||||
checkBlacklisted := func(log poll.LogT) poll.Result {
|
checkBlacklisted := func(log poll.LogT) poll.Result {
|
||||||
if fc.txCount.Load() == failuresUntilBlacklist {
|
if fc.txCount.Load() == failuresUntilBlacklist {
|
||||||
|
|
Loading…
Reference in a new issue