You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
# We randomly sleep a bit just to annoy the requester.
awaitself.clock.sleep(random.randint(1, 10))
These tests seem to be hitting this timeout, which the containing function has an arbitrary timeout value of 100 (which I believe means 10.0s). That means if a request takes >1s and we had a random sleep of 9s, the request will timeout.
Solutions here I can think of:
Upping this limit to something slightly higher (not sure what else relies on this though)
Weaving the timeout value through a bunch of functions all the way up to self.render such that these tests can explicitly say they expect to take slightly longer
Having a decorator, @override_timeout(150) similar to @override_config. This would be nice, though I'm not sure how exactly to pull it off
The text was updated successfully, but these errors were encountered:
Upping this limit to something slightly higher (not sure what else relies on this though)
Weaving the timeout value through a bunch of functions all the way up to self.render such that these tests can explicitly say they expect to take slightly longer
Having a decorator, @override_timeout(150) similar to @override_config. This would be nice, though I'm not sure how exactly to pull it off
Another option would be to patch random.randint to always return 0 for those tests or something. I think that's my running contender right now, unless we'd benefit from having the timeout be configurable anyway.
@clokep Perhaps instead we should make a function that generates timeouts for ShadowBanned users and mock that during tests? Something may rely on random.randint now or in future.
Edit: We're only mocking across a single TestCase instead of all tests, so there is no concern.
Description
The ShadowBanTestCase is flaky:
Likely due to requests sometimes being artificially slowed down to thwart malicious users:
synapse/synapse/handlers/room_member.py
Lines 316 to 317 in e259d63
These tests seem to be hitting this timeout, which the containing function has an arbitrary timeout value of
100
(which I believe means 10.0s). That means if a request takes >1s and we had a random sleep of 9s, the request will timeout.Solutions here I can think of:
timeout
value through a bunch of functions all the way up toself.render
such that these tests can explicitly say they expect to take slightly longer@override_timeout(150)
similar to@override_config
. This would be nice, though I'm not sure how exactly to pull it offThe text was updated successfully, but these errors were encountered: