r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 84 forks source link

Multiple testing processes with xdist all try to create the same runtime keyspace #125

Closed andydawkins closed 5 years ago

andydawkins commented 5 years ago

Found a bug when using pytest-django and django-cassandra-engine with pytest-xdist for multi-concurrency test execution.

The create_test_db method is creating the keyspace for the runtime database instead of the test database if it doesn't exist. This causes problems when testing with multiple concurrency because each testing process attempts to create the runtime database leading to all but one of the processes failing.

In truth you don't need to create the test database either since the sync_cassandra management command deals with that.

SeverinAlexB commented 5 years ago

Would be amazing to see this in the master. I have the same problems.

r4fek commented 5 years ago

Done, thank you very much! :)

EDIT: 1.5.5 released to PyPi.