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
Running parallel unit tests in Django breaks when using Cachalot 2.1.0.
Traceback (most recent call last):
File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/lib/python3.6/unittest/case.py", line 601, in run
self.setUp()
File "/home/kunal/leanagri/protect/tests.py", line 26, in setUp
nursery_area_factor=0.29)
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/query.py", line 394, in create
obj.save(force_insert=True, using=self.db)
File "/home/kunal/leanagri/core/models.py", line 111, in save
self.full_clean()
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/base.py", line 1245, in full_clean
self.validate_unique(exclude=exclude)
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/base.py", line 1034, in validate_unique
errors = self._perform_unique_checks(unique_checks)
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/base.py", line 1131, in _perform_unique_checks
if qs.exists():
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/query.py", line 670, in exists
return self.query.has_results(using=self.db)
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/sql/query.py", line 517, in has_results
return compiler.has_results()
File "/home/kunal/env3/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 858, in has_results
return bool(self.execute_sql(SINGLE))
File "/home/kunal/env3/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 32, in inner
return original(compiler, *args, **kwargs)
File "/home/kunal/env3/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 86, in inner
cache_key, table_cache_keys)
File "/home/kunal/env3/lib/python3.6/site-packages/cachalot/monkey_patch.py", line 40, in _get_result_or_execute_query
data = cache.get_many(table_cache_keys + [cache_key])
File "/home/kunal/env3/lib/python3.6/site-packages/cachalot/transaction.py", line 22, in get_many
data.update(self.parent_cache.get_many(missing_keys))
File "/home/kunal/env3/lib/python3.6/site-packages/cachalot/transaction.py", line 22, in get_many
data.update(self.parent_cache.get_many(missing_keys))
File "/home/kunal/env3/lib/python3.6/site-packages/django/core/cache/backends/memcached.py", line 96, in get_many
ret = self._cache.get_multi(new_keys)
File "/home/kunal/env3/lib/python3.6/site-packages/memcache.py", line 1216, in get_multi
retvals[prefixed_to_orig_key[rkey]] = val
KeyError: b'TEST:1:cc5377d1567fb2cc4c59ba5a48b7354d7c987aca'
The text was updated successfully, but these errors were encountered:
I'd like to hear if anyone's still having issues with this with --parallel. Would be helpful to know exactly wtf is going on!
Hi @Andrew-Chen-Wang: we are using cachalot and running our tests with --parallel and we’re not experiencing any issues. We are using Django 3.2 LTS and cachalot 2.4.2.
Edit:
We deactivate the caches when running unit tests. So this might be the reason why it works for us.
Running parallel unit tests in Django breaks when using Cachalot 2.1.0.
The text was updated successfully, but these errors were encountered: