mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 11:33:51 +00:00
I figure we can start with 600s as a maximum age -- our threads do many dozens of requests per minute, so I figure we'll get most of the benefit of permanently persisting connections this way. I could also be convinced to do just 60s, though the impact will likely to be less visible on staging. 600s seems to be what Django originally had for this parameter before they disabled it by default. See: https://groups.google.com/forum/#!msg/django-developers/rH0QQP7tI6w/yBusiFTNBR4J for discussion, which also suggests we might have issues with runserver that we should watch out for. (imported from commit 0ae09fa4f1b39cc88c76fa58258aaf20ab168dcf)
51 lines
1.5 KiB
Python
51 lines
1.5 KiB
Python
from settings import *
|
|
import os
|
|
|
|
DATABASES["default"] = {"NAME": "zulip_test",
|
|
"USER": "zulip_test",
|
|
"PASSWORD": "xxxxxxxxxxxx",
|
|
"HOST": "localhost",
|
|
"SCHEMA": "zulip",
|
|
"ENGINE": "django.db.backends.postgresql_psycopg2",
|
|
"TEST_NAME": "django_zulip_tests",
|
|
"OPTIONS": { },}
|
|
|
|
|
|
if "TORNADO_SERVER" in os.environ:
|
|
TORNADO_SERVER = os.environ["TORNADO_SERVER"]
|
|
else:
|
|
TORNADO_SERVER = None
|
|
|
|
# Decrease the get_updates timeout to 1 second.
|
|
# This allows CasperJS to proceed quickly to the next test step.
|
|
POLL_TIMEOUT = 1000
|
|
|
|
# Don't use the real message log for tests
|
|
EVENT_LOG_DIR = '/tmp/zulip-test-event-log'
|
|
|
|
# Print our emails rather than sending them
|
|
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend'
|
|
|
|
TEST_SUITE = True
|
|
RATE_LIMITING = False
|
|
# Don't use rabbitmq from the test suite -- the user_profile_ids for
|
|
# any generated queue elements won't match those being used by the
|
|
# real app.
|
|
USING_RABBITMQ = False
|
|
|
|
# Disable the tutorial because it confuses the client tests.
|
|
TUTORIAL_ENABLED = False
|
|
|
|
# Disable use of memcached for caching
|
|
CACHES['database'] = {
|
|
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
|
|
'LOCATION': 'zulip-database-test-cache',
|
|
'TIMEOUT': 3600,
|
|
'CONN_MAX_AGE': 600,
|
|
'OPTIONS': {
|
|
'MAX_ENTRIES': 100000
|
|
}
|
|
}
|
|
|
|
LOGGING['loggers']['zulip.requests']['level'] = 'CRITICAL'
|