mirror of https://github.com/zulip/zulip.git
8339c21637
Sometimes it's useful to run two copies of test-backend at the same time. The problem with doing so is that we need to make sure no two threads are using the same test database ID. Previously, this worked only if at most one of those copies was running in the single-threaded mode, because we used a random database ID for the single-threaded code path, but the same IDs counting from 0 for the parallel code path. Fix this, mostly, by generating a random start for the range of IDs used by the process, and then counting off database IDs starting from there (both in the parallel and non-paralllel modes). There's still a very low probability race, see the TODO. Additionally, there appear to be some other races with running two copies of test-backend at the same time not related to the database. See https://github.com/zulip/zulip/issues/12426 for a follow-up issue that's sorta created by this. |
||
---|---|---|
.. | ||
data_import | ||
lib | ||
management | ||
migrations | ||
openapi | ||
templatetags | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py | ||
static_header.txt |