✅ Fix failing memory database test
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Apr 2022 11:45:52 +0000 (13:45 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 16 Apr 2022 11:45:52 +0000 (13:45 +0200)
The test failed because of timing issues with the rate limiter when saving post
replies. The first part of the fix is to inject the rate limiter in the
constructor. The second part would be to create a special rate limiter that
only ever lets the first request pass and not the second one but for now a rate
limit of 1 element per 1000 seconds should be enough, even for the slowest
tests… unless it isn’t.

There are other rate limiters in the memory database which can cause other
tests to fail at random times in the future. Those will be left as an exercise
for another day.


No differences found