mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Fix regression with JS tests only working the first time.
The JS tests would fail on the second run due to memcache having dirty data. This change sets a new KEY_PREFIX whenever you launch a server in test mode. (imported from commit 4d41e6b79ab3bb7cb4c96b37050f0b1c9abc6b5e)
This commit is contained in:
parent
078defaf15
commit
71dec63ad1
@ -37,6 +37,11 @@ def memcached_stats_finish():
|
||||
memcached_total_time += (time.time() - memcached_time_start)
|
||||
|
||||
def get_or_create_key_prefix():
|
||||
if settings.TEST_SUITE:
|
||||
# This sets the prefix mostly for the benefit of the JS tests.
|
||||
# The Python tests overwrite KEY_PREFIX on each test.
|
||||
return 'test_suite:' + str(os.getpid()) + ':'
|
||||
|
||||
filename = os.path.join(settings.DEPLOY_ROOT, "memcached_prefix")
|
||||
try:
|
||||
fd = os.open(filename, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0444)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user